Show / Hide Table of Contents

Method filesystem.copyTo


Overload

Copies file or directory into another directory.

public static void copyTo(string path, string newDirectory, FIfExists ifExists = FIfExists.Fail, FCFlags copyFlags = 0, Func<FEFile, bool> fileFilter = null, Func<FEFile, int> dirFilter = null)
Parameters
path  (string)

Full path.

newDirectory  (string)

Full path of the new parent directory.

ifExists  (FIfExists)
copyFlags  (FCFlags)

Options used when copying directory.

fileFilter  (Func<FEFile, bool>)

Callback function that decides which files to copy when copying directory. See filesystem.enumerate. Note: this function uses FEFlags.NeedRelativePaths.

dirFilter  (Func<FEFile, int>)

Callback function that decides which subdirectories to copy when copying directory. See filesystem.enumerate. Note: this function uses FEFlags.NeedRelativePaths.

Exceptions
ArgumentException
  • path or newDirectory is not full path (see pathname.isFullPath).
  • path is drive. To copy drive content, use filesystem.copy.
FileNotFoundException

path not found.

AuException

Failed.

Remarks

Uses API CopyFileEx and CreateDirectoryEx. On Windows 7 does not copy security properties; sets default. Does not copy symbolic links (silently skips, no exception) if this process is not running as administrator. Creates the destination directory if does not exist (see filesystem.createDirectory).