Re: Can't find existing file

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

 



On Mon, Nov 22, 2010 at 16:54, Dee Ayy <dee.ayy@xxxxxxxxx> wrote:
> Hi Daniel,
> Tell me if this isn't self explanatory:
> ************
> cp ./photos/Nozzle\ 130\ Amp\ SS\ Alum\ 94-00994-06\ 220197.JPG
> "./photossized/001196-220197-0.jpg"
> cp: ./photos/Nozzle 130 Amp SS Alum 94-00994-06 220197.JPG: No such
> file or directory
> ************
> Thanks for trying.  Usually coders can read the error line and some
> folks like to see what you have done to attack the problem, hence the
> original "ls" line.  I could have omitted the original "Help" at the
> bottom.  I didn't think it would confuse anyone by adding it.  And
> maybe you haven't seen the "ls" command.

    I'm presuming you mean that I didn't see it in your email, and I'm
willing to leave it at that.

> Solving issue #1:  The getimagesize command wants filenames unquoted
> and unescaped.  Those quotes were an attempt to handle spaces in the
> filename, but ended up introducing the error.

    That's correct.  Functions like getimagesize() handle their own
slashing, et cetera.

> For issue #2, I think you meant "really does exist"; of course my code
> is to blame; the script is in the same dir as the photos and
> photossized dirs.  Thats what "./aDir" means -- but remember that only
> some are failing; cases are preserved; yes, unlikely; the disk has a
> lot of space; cp is on the path because "some" work; Obviously it's a
> PEBKAC issue, that's why I came to this php list, to get it pointed
> out; etc.

    No, I didn't, actually.  I meant "really doesn't exist."  If the
file really did exist at that location, it wouldn't be a problem.
That may not be THIS problem, but it is A problem.

> Solving issue #2 exec (or rather the shell) wants spaces escaped.  And
> yes, some files were there, but the lookup table had single spaces
> while the filename being compared had double spaces.

    Exactly.  Interacting with the shell using backticks, exec(),
passthru(), et al, is passed verbatim to the command line configured
with the server's user:group CLI environment.  Generally, when passing
arguments, you should escapeshellarg() the arguments.  And because the
files were misnamed, that means they didn't exist.  You knew which
files you wanted, and to you, it was simple.... but the computer
didn't know it, and when it looked for the files you wanted, they
didn't exist.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

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