NYCPHP Meetup

NYPHP.org

[nycphp-talk] Moving a file

David Krings ramons at gmx.net
Sat Sep 23 13:22:45 EDT 2006


Hi,

after looking around for a while it appears as that there is no single 
command to move a file from A to B. I know that I can first copy the file 
and then delete the source. In order to do so I'd need to check if the copy 
was successful and then check if the delete was successful. Is that so or 
am I just too dense to read the docs right?

Answering my own question but assuming that this may be interesting for 
some, I am not to dense. OK, that wasn't too interesting, I admit. What is 
interesting is that there is indeed no move function per sé, but I saw at 
http://webxadmin.free.fr/article/php-move-file-211.php that you can abuse 
the rename function to move a file...and potentially rename it at the same 
time.

Rarely found a case where a workaround is better than the desired solution.


David K.




More information about the talk mailing list