On Thursday, Sep 25, 2003, at 14:25 Etc/GMT, Ken Williams wrote:



On Thursday, September 25, 2003, at 12:33 AM, Greenhalgh David wrote:

On Wednesday, Sep 24, 2003, at 20:05 Etc/GMT, Ken Williams wrote:


Nope. When you open for reading ("<"), it won't be auto-created. It will when you open for writing or appending (">" or ">>").

-Ken

Not necessarily on every Mac. The same thing happens to me here, opening a file for writing does not create the file.


Well then, you didn't succeed in opening it for writing. =)

Try the following code, it will either die or create the files, depending on your permissions:

---------------------------
#!/usr/bin/perl
open FH, "> foo_write" or die "Can't create foo_write: $!";
print FH "some data\n";
close FH;

open FH, ">> foo_append" or die "Can't create foo_append: $!";
print FH "some data\n";
close FH;
---------------------------

There should be no variation of this behavior on any platform perl runs on, '>' and '>>' will always create the file first.

-Ken


Indeed it ought, and indeed it does on the FreeBSD target host and on my QS, but not on the TiG4. I am sure it is a very obscure permissions thing, though there's never an error in the log file. Mind you, this Powerbook has a record of flakiness so I'm not over-concerned. It's not Perl's fault!

Dave



Reply via email to