Re: File::Find problem on windows+apache+activePerl



Koolrans wrote:
Here is how I use the function.

@src_dir = "\\\\testnetwork\\filesToBeUploaded\\linux"
print "@src_dir";

Yikes. You are suffering from leaning toothpick syndrom.
And why an array when you are assigning only one string?
And that on Linux. I don't know for sure, but his line smells fishy to me.

find(\&processFiles, "@src_dir") or die ("Can't fetch information from
the find command: $! $@\n");

This works fine from commandline and gives an error when run from
apache. The print is successful and I can see the desired value in the
browser. The following error is logged into the log.

[Mon Feb 27 13:06:02 2006] [error] [client 10.2.20.109] Can't stat
\\\\testnetwork\\filesToBeUploaded\\linux: No such file or directory,

Well, I would guess: a permission problem. Or a problem with using the wrong
path separator.

As evident, it is an escape character issue

Well, maybe or maybe not.
First of all even on Windows you happily use normal forward slashes. Then
you don't get the leaning toothpick syndrom.
Second if you do want to have backslashes and you have a literal string and
don't want it stringified then use single quotes instead of double quotes.
Then even the backslash looses its special meaning and you don't have to
escape it.

$src_dir = '//testnetwork/filesToBeUpLoaded/linux';

jue


.



Relevant Pages

  • Re: Mandis Quotes (aka retiring """ and )
    ... > surround the string by a pair of doubled single quotes. ... > an arbitrary string in-between the single quotes which does NOT ... > of ASCII or Unicode characters, but instead as a sequence of lines ...
    (comp.lang.python)
  • Re: quotes from form input + MySQL insert query
    ... string mysql_escape_string ... > same way, but a textarea string full of single quotes is handled fine, while ... I've checked the POSTed data by echoing ... > backslashes, in case the single ones generated by magic_quotes weren't ...
    (alt.php)
  • Re: Mandis Quotes (aka retiring """ and )
    ... >surround the string by a pair of doubled single quotes. ... > of ASCII or Unicode characters, but instead as a sequence of lines ... Quoting "arbitrary" text also involves the issue of encoding, ...
    (comp.lang.python)
  • Problem with table.select(criteria)
    ... dsSessionMngr is a strongly typed dataset ... So I tried wrapping the criteria in single quotes and ... You can not use "=" when comparing datatypes string and int32. ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Trouble with SQL String in VBA
    ... It looks like the problem is with the string delimiters. ... *You have single quotes within single quotes. ... Dim rst As DAO.Recordset ... 'default bln to FALSE ...
    (microsoft.public.access.modulesdaovba)