PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

MoveFile,CopyFile

hi!

i have data in my record.$$$ and want to move it to
newfile. now i have a problem: first time i make this everything is ok, but at the second time(use same filename),i cannot overwrite file. if i use "CopyFile" my problem is solved,BUT the "record.$$$" is not deleted!! so what can i do?
ryanc · 25 Feb 2003, 15:34 UTC — MoveFile,CopyFile
Anonymous wrote:
same filename),i cannot overwrite file. if i use "CopyFile" my problem is solved,BUT the "record.$$$" is not deleted!! so what can i do?


I am pretty sure I have seen this before. I do not think that MoveFile works correctly, or rather it just won't move a file to a filename that already exists. Either use GetFileAttributes to determine if the file exists then use DeleteFile on it before using MoveFile, or use CopyFile then use DeleteFile on the old one.

ryanc
thanks a lot.