Platforms to show: All Mac Windows Linux Cross-Platform

WindowsFileCopyMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Windows MBS Win Plugin 9.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
A class to help you copying files on Windows using system functions.
  • event Progress(TotalFileSize as int64, TotalBytesTransferred as int64, StreamSize as int64, StreamBytesTransferred as Int64, StreamNumber as Integer, Reason as Integer) as Integer
  • 4 properties
  • 28 methods
    • method CopyFileEx(ExistingFileName as folderitem, NewFileName as folderitem, Flags as Integer) as boolean
    • method CopyFileEx(ExistingFileName as String, NewFileName as String, Flags as Integer) as boolean
    • method CopyFileSimple(ExistingFileName as folderitem, NewFileName as folderitem, FailIfExists as boolean=false) as boolean
    • method CopyFileSimple(ExistingFileName as String, NewFileName as String, FailIfExists as boolean=false) as boolean
    • method FileOperationCopy(source as folderitem, dest as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationCopy(source as string, dest as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationCopy(source as string, dest as string, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationCopy(source() as folderitem, dest as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationCopy(source() as folderitem, dest() as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationCopy(source() as string, dest as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationCopy(source() as string, dest as string, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationCopy(source() as string, dest() as string, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationDelete(file as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationDelete(filepathes as string, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationDelete(filepathes() as string, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationDelete(files() as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationMove(source as folderitem, dest as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationMove(source as string, dest as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationMove(source as string, dest as string, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationMove(source() as folderitem, dest as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationMove(source() as folderitem, dest() as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationMove(source() as string, dest as folderitem, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationMove(source() as string, dest as string, Flags as Integer, ProgressTitle as string="") as boolean
    • method FileOperationMove(source() as string, dest() as string, Flags as Integer, ProgressTitle as string="") as boolean
    • method MoveFileSimple(ExistingFileName as folderitem, NewFileName as folderitem) as boolean
    • method MoveFileSimple(ExistingFileName as String, NewFileName as String) as boolean
    • method MoveFileWithProgress(ExistingFileName as folderitem, NewFileName as folderitem, Flags as Integer) as boolean
    • method MoveFileWithProgress(ExistingFileName as String, NewFileName as String, Flags as Integer) as boolean
  • 29 constants

Constants

Constant Value Description
CallbackChunkFinished 0 One of the reason constants for the Progress event. Another part of the data file was copied.
CallbackStreamSwitched 1 One of the reason constants for the Progress event. Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked.
CopyFileAllowDecryptedDestination 8 One of the constants used with CopyFileEx. An attempt to copy an encrypted file will succeed even if the destination copy cannot be encrypted. Windows 2000: This value is not supported.
CopyFileCopySymLink &h800 One of the constants used with CopyFileEx. If the source file is a symbolic link, the destination file is also a symbolic link pointing to the same file that the source symbolic link is pointing to. Windows Server 2003 and Windows XP/2000: This value is not supported.
CopyFileFailIfExists 1 One of the constants used with CopyFileEx. The copy operation fails immediately if the target file already exists.
CopyFileOpenSourceForWrite 4 One of the constants used with CopyFileEx. The file is copied and the original file is opened for write access.
CopyFileRestartable 2 One of the constants used with CopyFileEx. Progress of the copy is tracked in the target file in case the copy fails. The failed copy can be restarted at a later time by specifying the same values for source and dest as those used in the call that failed.
FileOperationAllowUndo &h40 One of the flag constants for the FileOperation methods. Preserve undo information, if possible. more
FileOperationFilesOnly &h80 One of the flag constants for the FileOperation methods. Perform the operation only on files (not on folders) if a wildcard file name (*.*) is specified.
FileOperationMultiDestFiles 1 One of the flag constants for the FileOperation methods. The destination multiple destination files (one for each source file in from) rather than one directory where all source files are to be deposited.
FileOperationNoConfirmation &h10 One of the flag constants for the FileOperation methods. Respond with Yes to All for any dialog box that is displayed.
FileOperationNoConfirmationMkDir &h200 One of the flag constants for the FileOperation methods. Do not ask the user to confirm the creation of a new directory if the operation requires one to be created.
FileOperationNoConnectedElements &H2000 One of the flag constants for the FileOperation methods. Do not move connected files as a group. Only move the specified files.
FileOperationNoCopySecurityAttributes &h800 One of the flag constants for the FileOperation methods. Do not copy the security attributes of the file. The destination file receives the security attributes of its new folder.
FileOperationNoErrorUI &h400 One of the flag constants for the FileOperation methods. Do not display a dialog to the user if an error occurs.
FileOperationNoRecursion &h1000 One of the flag constants for the FileOperation methods. Only perform the operation in the local directory. Don't operate recursively into subdirectories, which is the default behavior.
FileOperationRenameCollision 8 One of the flag constants for the FileOperation methods. Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists at the destination.
FileOperationSilent 4 One of the flag constants for the FileOperation methods. Do not display a progress dialog box.
FileOperationSimpleProgress &h100 One of the flag constants for the FileOperation methods. Display a progress dialog box but do not show individual file names as they are operated on.

The plugin activates this flag if you pass in a window title.
FileOperationWantNukeWarning &H4000 One of the flag constants for the FileOperation methods. Send a warning if a file is being permanently destroyed during a delete operation rather than recycled. This flag partially overrides FileOperationNoConfirmation.
MoveFileCopyAllowed 2 One of the constants for the MoveFileWithProgress method. If the file is to be moved to a different volume, the function simulates the move by using the CopyFile and DeleteFile functions.
This value cannot be used with MoveFileDelayUntilReboot.
MoveFileCreateHardLink 16 One of the constants for the MoveFileWithProgress method. Reserved for future use.
MoveFileDelayUntilReboot 4 One of the constants for the MoveFileWithProgress method. The system does not move the file until the operating system is restarted. The system moves the file immediately after AUTOCHK is executed, but before creating any paging files. Consequently, this parameter enables the function to delete paging files from previous startups. more
MoveFileReplaceExisting 1 One of the constants for the MoveFileWithProgress method. If a file named lpNewFileName exists, the function replaces its contents with the contents of the lpExistingFileName file. more
MoveFileWriteThrough 8 One of the constants for the MoveFileWithProgress method. The function does not return until the file has actually been moved on the disk. more
ProgressCancel 1 One of the constants for the Progress Event return value. Cancel the copy operation and delete the destination file.
ProgressContinue 0 One of the constants for the Progress Event return value. Continue the copy operation.
ProgressQuiet 3 One of the constants for the Progress Event return value. Continue the copy operation, but stop invoking the event to report progress.
ProgressStop 2 One of the constants for the Progress Event return value. Stop the copy operation. It can be restarted at a later time.

This class has no sub classes.

Some examples using this class:

Blog Entries

Release notes


The items on this page are in the following plugins: MBS Win Plugin.


WindowsEthernetMBS   -   WindowsFileDescriptorMBS


💬 Ask a question or report a problem
The biggest plugin in space...