Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2763

Re: ftp with win-filenames with chr#32 ?

From Norman Peelman <npeelman@cfl.rr.com>
Newsgroups comp.lang.php
Subject Re: ftp with win-filenames with chr#32 ?
Date 2011-08-09 06:23 -0400
Organization A noiseless patient Spider
Message-ID <j1r1qs$duc$1@dont-email.me> (permalink)
References <4e401132$0$304$14726298@news.sunsite.dk> <j1q1t5$db0$1@dont-email.me> <j1q559$tak$1@dont-email.me>

Show all headers | View raw


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?-

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: ftp with win-filenames with chr#32 ? Norman Peelman <npeelman@cfl.rr.com> - 2011-08-08 21:18 -0400
  Re: ftp with win-filenames with chr#32 ? Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-08 22:13 -0400
    Re: ftp with win-filenames with chr#32 ? Norman Peelman <npeelman@cfl.rr.com> - 2011-08-09 06:23 -0400
  Re: ftp with win-filenames with chr#32 ? Bjarne Jensen <bjarne.b.jensen@gmail.com> - 2011-08-09 12:53 +0200
  Re: ftp with win-filenames with chr#32 ? Jo Schulze <antispam@feuersee.de> - 2011-08-17 00:05 +0200
    Re: ftp with win-filenames with chr#32 ? Norman Peelman <npeelman@cfl.rr.com> - 2011-08-16 19:12 -0400

csiph-web