By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,379 Members | 3,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,379 IT Pros & Developers. It's quick & easy.

copy/move files..

P: n/a
While reading php.net I found

" bool copy ( string $source , string $dest [, resource $context ] )
Makes a copy of the file source to dest .
If you wish to move a file, use the rename() function. "

..... what? rename can move a file...?
Jan 7 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Mon, 07 Jan 2008 17:22:02 +0100, jodleren <so*****@hot.eewrote:
While reading php.net I found

" bool copy ( string $source , string $dest [, resource $context ] )
Makes a copy of the file source to dest .
If you wish to move a file, use the rename() function. "

.... what? rename can move a file...?
Yes, with some caveats, quite common practice.
--
Rik Wasmus
Jan 7 '08 #2

P: n/a
.... what? rename can move a file...?

Never used DOS?
Jan 7 '08 #3

P: n/a
On Jan 7, 11:22 am, jodleren <sonn...@hot.eewrote:
While reading php.net I found

" bool copy ( string $source , string $dest [, resource $context ] )
Makes a copy of the file source to dest .
If you wish to move a file, use the rename() function. "

.... what? rename can move a file...?
Think of the entire folder path to the file as its name,
so if you have a file in folder /foo/bar/ named "Myfile" really how
the OS thinks of it is as a file named "/foo/bar/Myfile". if you
rename it to "/foo/BAZ/Myfile" it is now in the directory BAZ. its
"Name" for the OS has changed, even though its name for you, "Myfile"
hasn't. This is a gross oversimplification, but I think it should help
anyway.
Jan 7 '08 #4

P: n/a
jodleren wrote:
.... what? rename can move a file...?
Yeah. Welcome to the wonderful world of filesystem jargon.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Un ordenador no es un televisor ni un microondas, es una herramienta
compleja.
Jan 7 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.