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

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



Mark Manning/Muniz Eng. writes:
|> open F1, ">testfile" or die "can't create testfile: $!\n";
|> open F2, "<testfile" or die "can't open testfile: $!\n";
|> This works fine. If testfile didn't exist until it was closed, it wouldn't
|> work, the second open would fail with a "No such file or directory".
|However, the original question was: When I create a file I
|can not set the type and creator information.  Not - can I
|read the file immediately after opening the file.  :-/

Yes, quite true. However, it was posited that the reason the type
and creator weren't being set is that the file isn't actually
created. The second open shows that it is, as the open can find
the file in the file system. You could also replace the second open
with most functions that access a file by filename.

|Also, my question about your example is: Does the second
|OPEN statement cause the system to flush out any other
|system requests (such as file creations) before performing
|the second OPEN statement?

Nope. You can actually test this by running the above two lines,
then forcing your system to restart before the disk cache is
flushed. The file won't exist, because the directory entry was
never written (I think. Some system doesn't cache writes to
directory blocks, but I can't remember if it's Unix, the Mac,
or some proprietary system I've worked on.)

Brian

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