Re: File moving hell on Windows
| From: | Matt Graham | Date: | Wed, 01 Aug 2012 03:40:51 +0000 |
| Subject: | Re: File moving hell on Windows | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-318606@lists.php.net to get a copy of this message | ||
Mike Mackintosh wrote:
>> What protocol are you targeting? FTP, SFTP, SSH, SMB, etc?
From: Brian Dunning <brian@briandunning.com>
> Regular Windows networking.
If you're using a 'Doze box, and you want to use PHP functions like rename(),
then IIRC the only real option that you have is to do something like:
system("net use m: \\BORG\SHARE PASSWORD /user:DOMAIN\USER");
system("net use n: \\MACHINE\SHARE2 PASSWORD2 /user:DOMAIN2\USER2");
rename("n:/path/to/file","m:/path/to/otherfile");
/* more stuff */
system("net use n: \\MACHINE\SHARE2 /delete");
// equivalent of "umount //machine/share2"
However, there may be a better/easier/more elegant way to do these things.
Not sure; our PHP-running machines are all running Linux.
--
Matt G / Dances With Crows
The Crow202 Blog: http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see