MoveFile(SourceFile$, DestinationFile$) & more file comm
MoveFile(SourceFile$, DestinationFile$) & more file comm
Hello!
can you add the command MoveFile() to PB 4? It's annoying to copy+delete the files or to use API.
Adavntage of moving instead of copying and deleting: Imagine, you have got only 1 GB free on your disk or 1 MB on your floppy disk. How do you want to move a 2 Gb file (or 2 MB file) then? You cannot copy, becasue the file is larger than the rémaining free disk space...
And perhaps it would be good to add optional flags to DeleteFile(), so that you can delete read-only files?
What do you think?
can you add the command MoveFile() to PB 4? It's annoying to copy+delete the files or to use API.
Adavntage of moving instead of copying and deleting: Imagine, you have got only 1 GB free on your disk or 1 MB on your floppy disk. How do you want to move a 2 Gb file (or 2 MB file) then? You cannot copy, becasue the file is larger than the rémaining free disk space...
And perhaps it would be good to add optional flags to DeleteFile(), so that you can delete read-only files?
What do you think?
Last edited by AND51 on Wed Nov 22, 2006 4:24 pm, edited 1 time in total.
PB 4.30
Code: Select all
onErrorGoto(?Fred)
Re: MoveFile(SourceFile$, DestinationFile$)
For the first thing you mentioned:AND51 wrote:Hello!
can you add the command MoveFile() to PB 4? It's annoying to copy+delete the files or to use API.
Adavntage of moving instead of copying and deleting: Imagine, you have got only 1 GB free on your disk or 1 MB on your floppy disk. How do you want to move a 2 Gb file (or 2 MB file) then? You cannot copy, becasue the file is larger than the rémaining free disk space...
And perhaps it would be good to add optional flags to DeleteFile(), so that you can delete read-only files?
What do you think?
use RenameFile().
as long as you are operating on the same drive it works with RenameFile()

Yes make DeleteFile() take the flag #PB_FileSystem_Force
Last edited by Dummy on Tue Nov 21, 2006 9:40 pm, edited 1 time in total.
I didn't know that; I will test it ASAP. If it would be in the help, that renaming a file makes the file moving, I wouldn't have asked.
Danke Tranquil, aber du benutzt API, das geht auf anderen OS nicht (auch, wenn ich eh nur Windows benutze).
Danke Tranquil, aber du benutzt API, das geht auf anderen OS nicht (auch, wenn ich eh nur Windows benutze).
PB 4.30
Code: Select all
onErrorGoto(?Fred)
This is no excuse for it not being in the manual where it belongs!Trond wrote:You should have searched. A search for MoveFile gives you the answer.
And the second request is good enough.
Last edited by thefool on Tue Nov 21, 2006 9:40 pm, edited 1 time in total.
Linux is worse - there's no command line command to rename a file!thefool wrote:This is no excuse for it not being in the manual where it belongs!Trond wrote:You should have searched. A search for MoveFile gives you the answer.
And the second request is good enough.
Also this was already requested, no need for a new thread: http://www.purebasic.fr/english/viewtop ... t=movefile
Re: MoveFile(SourceFile$, DestinationFile$)
[OFFTOPIC]
[/OFFTOPIC]
c ya,
nco2k
yes and #PB_FileSystem_EmptyOnly flag for DeleteDirectory().Dummy wrote:Yes make DeleteFile() take the flag #PB_FileSystem_Force

[/OFFTOPIC]
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Absolutely @ nco2k
By the way, I edited the title of this topic, now you can post all of you file-library-wishes!
By the way, I edited the title of this topic, now you can post all of you file-library-wishes!

PB 4.30
Code: Select all
onErrorGoto(?Fred)