File Manipulation Code

  Home arrow File Manipulation Code arrow Recursive Copy Function

Recursive Copy Function
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2

    Table of Contents:



    Copies an entire directory and sub-directories recursively. Usage is COPY_RECURSIVE_DIRS(source_directory, target_directory). This is based on mugane's Recursive Delete Function

    By : noisia

    function COPY_RECURSIVE_DIRS($dirsource, $dirdest)
    { // recursive function to copy
    // all subdirectories and contents:
    mkdir($dirdest."/".$dirsource, 0750);
    if($file!="." && $file!="..")
    if(!is_dir($dirsource."/".$file)) copy ($dirsource."/".$file, $dirdest."/".$dirsource."/".$file);
    else COPY_RECURSIVE_DIRS($dirsource."/".$file, $dirdest);
    return true;
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More File Manipulation Code Articles
    More By Codewalkers

    blog comments powered by Disqus


    - Bandwidth Control with pure PHP
    - Eazy Gallery
    - file_get_contents for PHP < 4.3.0
    - PHP Class: Image Snapshot 1.3
    - Universal downloader
    - Image Gallery v2.0
    - Free/Used Disk Space
    - Directory Lister
    - Directory image view, with selective hidden
    - Move or Copy a Directory (and files and sub ...
    - Ensure_Sub_Directory_Exists
    - Wedit
    - Form Examples Text Boxes to Drop Downs
    - myFiles
    - List files in a directory, no subdirectories

    Developer Shed Affiliates


    © 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap