|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||Files||MBS MacOSX Plugin||19.4||Yes||No||No||Yes, macOS only||No|
We provide a class to hold state and get event for progress.
Uses low level copyfile API from MacOS.
See copyfile man page in terminal.
- event Progress(What as Integer, Stage as Integer, Source as String, Dest as String) as Integer
- 4 properties
- 2 methods
- shared method ErrorMessage(error as Integer) as String
- 35 constants
Copy the source file's access control lists.
Copy the entire file; equivalent to BitwiseOr(kFlagsMetaData, kFlagsData).
Return a bitmask (corresponding to the flags argument) indicating which contents would be copied; no data are actually copied. (E.g., if flags was set to kFlagsCheck + kFlagsMetaData, and the from file had extended attributes but no ACLs, the return value would be kFlagsXAttr.)
Try to clone the file instead. This is a best try flag i.e. if cloning fails, fallback to copying the file. This flag is equivalent to BitwiseOr(kFlagsExcl, kFlagsACL, kFlagsStat, kFlagsXAttr, kFlagsData, kFlagsNoFollowSource).
Note that if cloning is successful, progress event will not be invoked. Note also that there is no support for cloning directories: if a directory is provided as the source and kFlagsCloneForce is not passed, this will instead copy the directory. Recursive copying however is supported.
Clone the file instead. This is a force flag i.e. if cloning fails, an error is returned. This flag is equivalent to BitwiseOr(kFlagsExcl, kFlagsACL, kFlagsStat, kFlagsXAttr, kFlagsData, kFlagsNoFollowSource). Note that if cloning is successful, progress callbacks will not be invoked. Note also that there is no support for cloning directories: if a directory is provided as the source, an error will be returned.
Copy the source file's data.
Copy a file sparsely. This requires that the source and destination file systems support sparse files with hole sizes at least as large as their block sizes.
If kFlagsData is also specified, this will fall back to a full copy if sparse copying cannot be performed for any reason; otherwise, an error is returned.
Fail if the to file already exists.
Copy the metadata; equivalent to BitwiseOr(kFlagsSecurity, kFlagsXAttr).
Unlink (using remove(3)) the from file.
No error is returned if remove(3) fails. Note that remove(3) removes a symbolic link itself, not the target of the link.
This is a convenience macro, equivalent to BitwiseOr(kFlagsNoFollowDest, kFlagsNoFollowSource).
Do not follow the to file, if it is a symbolic link.
Do not follow the from file, if it is a symbolic link.
Serialize the from file. The to file is an Apple-Double-format file.
Causes copyfile to recursively copy a hierarchy.
If the src file has quarantine information, add the QTN_FLAG_DO_NOT_TRANSLOCATE flag to the quarantine information of the dst file. This allows a bundle to run in place instead of being translocated.
Copy the source file's POSIX and ACL information; equivalent to BitwiseOr(kFlagsStat,kFlagsACL).
Copy the source file's POSIX information (mode, modification time, etc.).
Unlink the to file before starting.
Unserialize the from file. The from file is an AppleDouble-format file; the to file will have the extended attributes, ACLs, resource fork, and FinderInfo data from the to file, regardless of the flags argument passed in.
Copy the source file's extended attributes.
Event Return Values
The copy will continue as expected.
The data copy will be aborted; in the case of kStageProgress, result will be set to ECANCELED (89).
The data copy will be aborted, but without error.
Indicates an error has happened at some stage.
After copying has successfully finished.
Copy in progress.
Before copying has begun.
Data is copied currently.
Extended attributes are copied currently.
The object being copied is a directory, and is being entered. (That is, none of the filesystem objects contained within the directory have been copied yet.)
The object being copied is a directory, and all of the objects contained have been copied. At this stage, the destination directory being copied will have any extra permissions that were added to allow the copying will be removed.
There was an error in processing an element of the source hierarchy; this happens when fts(3) returns an error or unknown file type.
The object being copied is a file (or, rather, something other than a directory).
This class has no sub classes.
Some examples which use this class:
- MonkeyBread Software Releases the MBS Xojo Plugins in version 19.4
- MBS Xojo Plugins, version 19.4pr3
Xojo Developer Magazine
The items on this page are in the following plugins: MBS MacOSX Plugin.
MBS FileMaker Plugins