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

Re: [MacPerl] MacPerl::SetFileInfo Help (fwd)



According to D. Beverly:
> 
> I mean that...
> 
> open ( OUT, ">$myNewFile" );
> # do stuff to the file
> MacPerl::SetFileInfo ( 'ALFA', 'TEXT', $myNewFile );
> close ( OUT );
> 
> does not always result in what I want, which is an Alpha text file, in 
> this case.  Sometimes the resulting file is an MPW text file.  If the 
> Finder says it didn't work, then it didn't.  The desired effect was not 
> achieved.
> 
> So now, instead of Matthias' suggestion of open/close/open, I create and 
> manipulate the files, close them, then do this, after all files are 
> created, and known to exist:

Ugh.  :-(  Matthias didn't say that - I did.  :-/  And all
I did was to pass along what I'd read from an Apple rep a
while ago.  And "a while ago" means something like two
months to a year ago.  :-)

After thinking about it last night I came up with a
secondary scenario where SetFileInfo may not work.  This is
similar to why I do the OPEN/CLOSE/OPEN.

NOW - BEFORE I SAY ANYTHING >>>>THIS IS JUST CONJECTURE ON
MY PART<<<< and not something I read which some Apple
person posted.  So this is just pure "What IF"!  Ok?

Let's suppose that the OPEN statement opens an I/O
channel.  Ok - not too hard to do.

Let's suppose that the OPEN statement tells the Mac System
to provide an exclusive lock on the file so no one else can
talk to the file.

Let's suppose that the SetFileInfo command also opens an
I/O channel.

Let's also suppose that the SetFileInfo command also
attempts to open the "exclusive lock" file.

Then SetFileInfo would not be able to open the file until
the file had been closed.

Remember!  This is all supposition on my part and has no
basis in reality other than it follows a logical set of
steps.

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch