Re: ftp with win-filenames with chr#32 ? [message #175054] |
Tue, 09 August 2011 01:18 |
Norman Peelman
Messages: 126 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 08/08/2011 12:39 PM, Bjarne Jensen wrote:
> if (ftp_chdir($conn_id, "C:\Program Files")) {
> echo "REMOTE dir is now: " . ftp_pwd($conn_id) . "<br>";
> }
> else { echo "Couldn't change directory\n";
> }
>
>
> Warning: ftp_chdir() [function.ftp-chdir]: "C:\Program Files": Directory
> not found. in /var/www/ftp.php on line 20
> Couldn't change directory
>
> ---------
>
> How do you work around that?
> (yes, the dir is there)
>
> /Bjarne
Looks like you're mixing Windows paths with a linux/unix server...
but since it is possible to to have directories named like that, try:
ftp_chdir($conn_id, "C\:\\Program\ Files/");
You need to escape the ':' and spaces... and check the permissions.
--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
|
|
|
Re: ftp with win-filenames with chr#32 ? [message #175055 is a reply to message #175054] |
Tue, 09 August 2011 02:13 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 8/8/2011 9:18 PM, Norman Peelman wrote:
> On 08/08/2011 12:39 PM, Bjarne Jensen wrote:
>> if (ftp_chdir($conn_id, "C:\Program Files")) {
>> echo "REMOTE dir is now: " . ftp_pwd($conn_id) . "<br>";
>> }
>> else { echo "Couldn't change directory\n";
>> }
>>
>>
>> Warning: ftp_chdir() [function.ftp-chdir]: "C:\Program Files": Directory
>> not found. in /var/www/ftp.php on line 20
>> Couldn't change directory
>>
>> ---------
>>
>> How do you work around that?
>> (yes, the dir is there)
>>
>> /Bjarne
>
> Looks like you're mixing Windows paths with a linux/unix server... but
> since it is possible to to have directories named like that, try:
>
> ftp_chdir($conn_id, "C\:\\Program\ Files/");
>
> You need to escape the ':' and spaces... and check the permissions.
>
Neither colons nor spaces need to be escaped. In fact, "\:" and "\ "
are illegal escape sequences.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: ftp with win-filenames with chr#32 ? [message #175059 is a reply to message #175055] |
Tue, 09 August 2011 10:23 |
Norman Peelman
Messages: 126 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 08/08/2011 10:13 PM, Jerry Stuckle wrote:
> On 8/8/2011 9:18 PM, Norman Peelman wrote:
>> On 08/08/2011 12:39 PM, Bjarne Jensen wrote:
>>> if (ftp_chdir($conn_id, "C:\Program Files")) {
>>> echo "REMOTE dir is now: " . ftp_pwd($conn_id) . "<br>";
>>> }
>>> else { echo "Couldn't change directory\n";
>>> }
>>>
>>>
>>> Warning: ftp_chdir() [function.ftp-chdir]: "C:\Program Files": Directory
>>> not found. in /var/www/ftp.php on line 20
>>> Couldn't change directory
>>>
>>> ---------
>>>
>>> How do you work around that?
>>> (yes, the dir is there)
>>>
>>> /Bjarne
>>
>> Looks like you're mixing Windows paths with a linux/unix server... but
>> since it is possible to to have directories named like that, try:
>>
>> ftp_chdir($conn_id, "C\:\\Program\ Files/");
>>
>> You need to escape the ':' and spaces... and check the permissions.
>>
>
> Neither colons nor spaces need to be escaped. In fact, "\:" and "\ " are
> illegal escape sequences.
>
Ahh, was looking at terminal usage thinking it was the same... (now
i'm mixing bash and servers). I'd still like to see the directory
structure. Looks like something to keep a script from breaking.
--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
|
|
|
Re: ftp with win-filenames with chr#32 ? [message #175060 is a reply to message #175054] |
Tue, 09 August 2011 10:53 |
Bjarne Jensen
Messages: 9 Registered: January 2011
Karma: 0
|
Junior Member |
|
|
On 2011-08-09 03:18, Norman Peelman wrote:
> Looks like you're mixing Windows paths with a linux/unix server... but
> since it is possible to to have directories named like that, try:
Yes, should have written that I'm trying to access a win server fom a
linux box.
Tks!
|
|
|
|
Re: ftp with win-filenames with chr#32 ? [message #175152 is a reply to message #175149] |
Tue, 16 August 2011 23:12 |
Norman Peelman
Messages: 126 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 08/16/2011 06:05 PM, Jo Schulze wrote:
> Norman Peelman wrote:
>
>> You need to escape the ':'
>
> Nope
Uh, yeah... we came to that conclusion last week. Thanks though.
--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
|
|
|