On Tue, Jul 02, 2002 at 07:07:51PM -0400, James B wrote:
> Is it possible to do this with a file name that *I* specify? Call a open
> command with a specfied filename that will give an error if the file
> already exists but otherwise create it & open it for writing?
Didn't I already answer this question?
use Fcntl qw(O_WRONLY O_CREAT O_EXCL);
sysopen(FILE, $filename, O_WRONLY|O_CREAT|O_EXCL) || die ...
> I'm afraid I'm being very fernickety here; the code I'm writing needs to
> run on a range of systems; debian, free bsd, mac os x, and preferaly
> windows to so I'm very fussily avoiding calling as little extra baggage as
> needed. I could use calls to RCS to achieve what I want but I want to avoid
> that ...
The above should work fine on Debian, FreeBSD, and MacOSX. You might have
issues with Windows. I would suggest testing the code on the systems you
want it to run on, to verify.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]