From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,3c4ff193a1aba51d X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,3c4ff193a1aba51d X-Google-Attributes: gid1164f8,public X-Google-Thread: f86d6,3c4ff193a1aba51d X-Google-Attributes: gidf86d6,public X-Google-Thread: 11062c,3c4ff193a1aba51d X-Google-Attributes: gid11062c,public From: rankin@eql.caltech.edu (Pat Rankin) Subject: Re: QUESTION: Porting Unix Code To GNU C On VAX/VMS... Date: 1997/05/21 Message-ID: <21MAY199719454835@eql.caltech.edu>#1/1 X-Deja-AN: 242976960 Distribution: world References: <1997May21.171439@news.all-net.net> Organization: California Institute of Technology News-Software: VAX/VMS VNEWS 1.41x8 Newsgroups: comp.os.vms,comp.sys.dec,vmsnet.sysmgt,vmsnet.tcp In article <1997May21.171439@news.all-net.net>,\ byer@mail.all-net.net (Robert Byer) writes... [...] > My question is, what is the equiv of the Unix "unlink" in GNU C v2.7.1 > for VMS or for that matter VAXC. The answer is the same for either compiler since both assume that you're using VAXCRTL as your C run-time library. (VAXCRTL is part of VMS rather than being provided by either compiler.) Most of the time unlink() is used simply to delete a file, so you can just add #define unlink(X) remove(X) to the source code and use the ANSI sanctioned method for deleting a file. *But* unlink() under Unix actually does something different whenever the specified file has more than one directory entry, and there is no general way to emulate that under VMS. (Otherwise VAXCRTL would have implemented it along with the other bits of Unix emulation present.) There are cases where you could reliably remove directory entries instead of deleting files, such as when your own code is creating the alternate directory entries, but it isn't exactly trivial and you're probably not going to need generality anyway. Pat Rankin, rankin@eql.caltech.edu