bobby wrote:
hi to all,
I'm making a program to sort a collection of specific files.
Now, is there a crossplatform function to move/copy/rename files?
If not, how can I do it for Win32?
For a non-multiplatform app you can use the Windows API call CopyFile.
From MSDN:
The CopyFile function copies an existing file to a new file.
BOOL CopyFile(
LPCTSTR lpExistingFileName, // pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
Parameters
lpExistingFileName
Points to a null-terminated string that specifies the name of an
existing file.
lpNewFileName
Points to a null-terminated string that specifies the name of the new file.
bFailIfExists
Specifies how this operation is to proceed if a file of the same name as
that specified by lpNewFileName already exists. If this parameter is
TRUE and the new file already exists, the function fails. If this
parameter is FALSE and the new file already exists, the function
overwrites the existing file and succeeds.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error
information, call GetLastError.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives