Show / Hide Table of Contents

Method filesystem.copy


Overload

Copies file or directory.

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

Full path.

newPath  (string)

Full path of the destination.

note

It is not the new parent directory. See filesystem.copyTo.

ifExists  (FIfExists)

Enum: Fail, Delete, RenameExisting, MergeDirectory, RenameNew.

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 newPath is not full path (see pathname.isFullPath).

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).