in reply to Re: open() enhancements
in thread open() enhancements

Two-arg open considered dangerous; syntax on the way out; etc.

I've also read in Perl books how great it is, so that a script that takes a "file name" argument can actually do all that stuff.

I do like the 4th argument as a hash. There can be universal "well known" names, and OS or FS specific flags that are only respected if applicable, such as { WIN32::tempfile => 1 } which would use the native temp file flag which may be somewhat different in meaning from a Linux temp file flag, etc. That is, by using a namespace-like syntax, flags can keep out of each other's way and not pollute the option space.

Replies are listed 'Best First'.
Re3: open() enhancements
by blakem (Monsignor) on Aug 23, 2002 at 02:27 UTC
    I've also read in Perl books how great it is, so that a script that takes a "file name" argument can actually do all that stuff.
    The two don't really relate that strongly... For security's sake you need to parse and verify the filename param to the script before handing it to open anyway. A design making it easy to pass unverified user input to potentially destructive syscalls is just inviting trouble.

    But then, I think we agree for the most part. We both seem to like the 4th argument hash idea. ;-)

    -Blake

      So, who do we lobby about it?