Re: File Copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Aidal,
presumably, your server had the write to copy the file, otherwise the copy would have failed. Is the only problem that you don't have the correct permissions on the copied file?? if so check out
<http://www.php.net/manual/en/function.umask.php>. If you set the umask before you copy, you should have the correct permissions.


Best regards. . . Dusty
Silvio Porcellana wrote:
Chris Dowell wrote:

Aidal

Could you post the relevant parts of your code so we have a little context to work in?

You say you're copying a file from one location to another on the same server. If this is the case you are very unlikely to be in need of the ftp family of functions, which are only valid for use over an established ftp connection.

You can indeed establish an FTP connection to your local server - provided it has an FTP server running.
The files are actually copied by Apache (or whatever Web server he's using), so this is why the server becomes the owner.


I suspect that the file is indeed now owned by the webserver

has it changed from aidal:somegroup to nobody:nogroup or something like that?

I guess this is the problem Aidal is experiencing.

In order to maintain file ownserships, what he can do (since he doesn't have PHP 5) is "copy" the file with 'ftp_fput()' [http://php.libero.it/manual/en/function.ftp-fput.php].
That is, he opens the files he wants to copy and PUTs it via this function. Since he is logged in - using 'ftp_connect()' and 'ftp_login()' - the files will be owned by the user he used to login.


My .2 euros...

Cheers,
Silvio Porcellana

<snip>

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux