![]() If overwrite is False then the move is aborted. If source is a file and an identically named file exists as a child of the destination folder then the existing file in destination is deleted first and then the source file is moved to destination if overwrite is True.destination refers to the folder that you want to source to be moved into. destination must be a folder and must exist. Result As FileKit.Error = folderItemVariable.MoveTo(destination As FolderItem, overwrite As Boolean) ![]() Result As FileKit.Error = FileKit.MoveTo(source As FolderItem, destination As FolderItem, overwrite As Boolean) To move a file or folder you can use either the module method or the FolderItem extension: ![]() If overwrite is False then the copy is aborted. If source is a folder and an identically named folder exists as a child of the destination folder then the existing folder in destination is deleted first and the source folder (and its contents) are recursively copied into destination if overwrite is True.If source is a file and an identically named file exists as a child of the destination folder then the existing file in destination is deleted first and then the source file is copied to destination if overwrite is True.The overwrite parameter specifies what happens in the following scenarios: destination refers to the folder that you want the copied file or folder to end up as a child of. The list of error codes can be found in the errors section. The method returns an error code in the form of a FileKit.Error enumeration. Result As FileKit.Error = folderItemVariable.CopyTo(destination As FolderItem, overwrite As Boolean) Result As FileKit.Error = FileKit.CopyTo(source As FolderItem, destination As FolderItem, overwrite As Boolean) To copy a file or folder you can use either the module method or the FolderItem extension: Be very careful when using this mode! Copying a file or folder If you set FileKit.safeMode = False then the module will delete any folder or file on the drive (including the root folder) if requested. The list of the protected folders depends on the platform. When True, the module will not delete a number of special folders. The module includes a boolean property ( safeMode) which defaults to True. The module supports Mac, Windows, Linux and ARM web, desktop and console builds. Usageįirstly copy the FileKit module in the downloaded project to your own project. The repo contains a Xojo project with a demonstration window containing the FileKit module. This module uses the cp and mv shell commands on Unix systems (macOS and Linux) and the move and xcopy commands on Windows. This is particularly true on Windows (especially Windows 10). ![]() I created it because the native FolderItem (and Xojo.IO.FolderItem for that matter) copy, move and delete methods are buggy. FileKit is a Xojo module for robustly handling classic framework FolderItem copying, deletion and moving. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |