Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » FileMove behaviour
FileMove behaviour [message #26523] Sat, 08 May 2010 15:00 Go to next message
forlano is currently offline  forlano
Messages: 1202
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

using the funztion

bool FileMove(const char *oldname, const char *newname)

I have noticed that in case a file named "newname" already exist the file "oldname" is not moved. Is it supposed to work in this way?

Sometimes one would move a file irrispective of the presence of "newname" file. So something like this

bool FileMove(const char *oldname, const char *newname, bool overwrite=true)

would be handy in case one does not care about a previous existence.

Luigi
Re: FileMove behaviour [message #26526 is a reply to message #26523] Sun, 09 May 2010 19:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
forlano wrote on Sat, 08 May 2010 09:00

Hello,

using the funztion

bool FileMove(const char *oldname, const char *newname)

I have noticed that in case a file named "newname" already exist the file "oldname" is not moved. Is it supposed to work in this way?



Yes.

Quote:


Sometimes one would move a file irrispective of the presence of "newname" file. So something like this

bool FileMove(const char *oldname, const char *newname, bool overwrite=true)

would be handy in case one does not care about a previous existence.

Luigi



Well, why do not you just call

DeleteFile(newname);

? (If there is no newname, it will fail, which you can ignore, right?)
Re: FileMove behaviour [message #26529 is a reply to message #26526] Sun, 09 May 2010 20:18 Go to previous message
forlano is currently offline  forlano
Messages: 1202
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Sun, 09 May 2010 19:34


DeleteFile(newname);

? (If there is no newname, it will fail, which you can ignore, right?)


Yes and already done Smile .
Just I was thinking in lazy mode ON.

Luigi
Previous Topic: what about VectorBiMap / ArrayBiMap ?
Next Topic: Date is broken for years below one.
Goto Forum:
  


Current Time: Fri Nov 01 00:03:50 CET 2024

Total time taken to generate the page: 0.02253 seconds