At 07.35 -0500 1999.01.03, Bart Lateur wrote: >On Sat, 2 Jan 1999 18:02:11 -0500, Chris Nandor wrote: > >>flock() does not work with MacPerl. One method that can work is with a >>separate lock file: create a file called "file.lock" and have your other >>programs fail while "file.lock" exists. That approach is flawed in some >>ways (if your program dies, then everything is locked out until you fix it >>manually or something), but it is an alternative. > >Then try opening the file for output. > >Unlike Unix, but like PC, the Mac only allows opening for writing only >to one program at a time. If your script dies, the file is automatically >closed. Problem solved. But the question was how to do this portably. This method works of MacOS particulars and will not work on other platforms. >I'm not sure what good it is. After all, you can only run one MacPerl >script at a time. Or do you plan to simultaniously open this file using >another program as well? You can run multiple MacPerl programs, if you have multiple MacPerl interpreters, which I do sometimes. And it is not a bad idea to plan for the future, because it is likely that some time this year, you will be able to run multiple scripts from within one MacPerl app. -- Chris Nandor mailto:pudge@pobox.com http://pudge.net/ %PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6']) ***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch