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

Re: [MacPerl] Newbie question



on 9/29/00 1:31 PM, Paul Schinder at schinder@pobox.com wrote:

> At 12:45 PM -0500 9/29/00, <CoDeReBeL@hotmail.com> wrote:
>> I'm also assuming that Perl will refuse to open a file for writing that
>> already is, which also seems reasonable.
> 
> This depends entirely on the operating system.  It certainly isn't
> true under Unix, where you can open a file for writing as many times
> as you want.  It may or may not be true for MacPerl.  You might be
> able to find out from Mac OS using a toolbox call.
> 
> --
> --
> Paul Schinder
> schinder@pobox.com
> 

Overwhelmed with curiosity, I decided to find out what the deal was. If any
process *except* MacPerl has a file open for writing, then

open (WHATEVER, '+<theFileName')

returns false. If, however, the process that has the file open for writing
is MacPerl itself, it returns true. I used MPW in the test. Presumably,
standalone applications and droplets count as separate processes.


Rusty


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org