delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/27/21:48:57

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: files
Date: 27 Mar 2000 13:45:22 -0800
Organization: InterWorld Communications
Lines: 29
Message-ID: <8366u8ccjx.fsf@mercury.st.hmc.edu>
References: <jcsD4.4971$jX3 DOT 69233 AT typhoon DOT nyroc DOT rr DOT com> <200003270928 DOT LAA16362 AT maggiore DOT iperbole DOT bologna DOT it>
NNTP-Posting-Host: mercury.st.hmc.edu
Mime-Version: 1.0
X-Trace: nntp1.interworld.net 954193623 62031 134.173.45.219 (27 Mar 2000 21:47:03 GMT)
X-Complaints-To: usenet AT nntp1 DOT interworld DOT net
NNTP-Posting-Date: 27 Mar 2000 21:47:03 GMT
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5
To: djgpp AT Delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

pad2369 <pad2369 AT iperbole DOT bologna DOT it> writes:

> Quota John <fubu36 AT stny DOT rr DOT com>:
> 
> > I am trying to make a database. The only way I could 
> come up with to update
> > a file was to write a new one from the current one 
> inserting then new stuff
> > at the right place. Aftrer this is done how would I 
> delete the old file and
> > rename the new one to the correct name? thanks
> 
> You can use unlink() to remove files and rename() / 
> _rename() to rename files.
> 
> Talking about portability, I am sure unlink() is posix, 
> while I am not sure about rename()...

rename() is in the Single Unix Spec, which mentions that it comes from
POSIX.1.  So yes.

_rename is not portable at all; this is true of almost anything
beginning with an underscore.  (_exit is an exception; it's in the SUS
and supposedly was in SVID (System V Interface Definition)).

-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019