copyfile

Copies all the files in a directory and all of its subdirectories
327 Downloads
Updated 27 Nov 2012

View License

Copies all the files in a directory and all of its subdirectories and places the results in a new folder.
% [list,numfiles] = copyfile(ext,copypath,pastepath);
% written by Joseph Hollmann, April 2011
% created to copy all files of a given type from one directory and all of its
% subdirectories. Places all files in a new directory
% Input:
% ext - file extension to be copied (i.e. 'm' for m-files)
% pathname - directory to be searched
% Outputs:
% list - all the filenames with srchwrd
% numfiles - number of files in list

% persistent copypath pastepath; % allows the same path to be utilized several times
% copypath - path files exist
% pastepath - path to copy files to

Cite As

Joseph Hollmann (2024). copyfile (https://www.mathworks.com/matlabcentral/fileexchange/39182-copyfile), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Low-Level File I/O in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0