On Saturday, June 29, 2002, at 05:37 , <[EMAIL PROTECTED]> 
wrote:

> Hello there!
> I wrote a script which I tested on Linux and Windows XP.
> The following code works differently on the OS.
> $path = /data/../dir/Sound
> $filename = $query->param('filename');

$filename ||= "safety.txt";

> open(DIR,">$path/$filename");
> binmode(DIR);
> print DIR $_;
> close (DIR);
> On Linux, instead of the $filename being written to the Sound directory,
> I get the message "/data/../dir/Sound/ Is a directory. It doesn't seem to
> read the filename.

it appears that in the 'linux' case you have an empty
'filename' - hence

        "path/$filename" == "/data/../dir/Sound/ "

Hence the effort to 'open append' is failing - as it notes,
because there is a Directory at that point, and one does not
wish to turn Directories into 'flat files' willy nilly,
even if that is, as you suggest acceptable under XP.

when you wanted it to equal say

        "/data/../dir/Sound/ThatFile"

So you really need to check that the thing you wish
to open and write makes sense - before, taking the
error case that one was trying to do a bad thing
and being informed of same by the system...

ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to