Article 170425 of comp.os.vms:
In article <1997May21.171439@news.all-net.net>, byer@mail.all-net.net (Robert Byer) writes:
> -----BEGIN PGP SIGNED MESSAGE-----
> 
> 
> Hi.
> 
> I'm trying to port over a Unix application to VMS using GNU C v2.7.1 and
> so far it's going great.
> 
> But, I don't have the "unlink" function which is kinda vital for this
> application.
> 
> My question is, what is the equiv of the Unix "unlink" in GNU C v2.7.1
> for VMS or for that matter VAXC.
> 
> I don't know all that much acout Unix programming or VAX programming so
> I would appreciate any and all help on this.

Try:


/*      Fudge to allow the UNIX unlink() to work        */
#include <descrip.h>
#include <string.h>
#include <lib$routines.h>
unlink(filename)
char *filename;
{
    static struct dsc$descriptor_s file_desc;
    file_desc.dsc$w_length = strlen(filename);
    file_desc.dsc$b_dtype  = DSC$K_DTYPE_T;
    file_desc.dsc$b_class  = DSC$K_CLASS_S;
    file_desc.dsc$a_pointer= filename;
    return (lib$delete_file(&file_desc));
}

(Extracted from XVMS utils Unix emlulation routines)

Patrick

-- 
===============================================================================
pmoreau@cena.dgac.fr  (CENA)     ______      ___   _           (Patrick MOREAU)
moreau_p@decus.decus.fr(DECUS)  / /   /     / /|  /|
CENA/Athis-Mons FRANCE         / /___/     / / | / |   __   __   __   __  
BP 205                        / /         / /  |/  |  |  | |__| |__  |__| |  |
94542 ORLY AEROGARE CEDEX    / /   ::    / /       |  |__| | \  |__  |  | |__|
Web Page: http://www2.cenaath.cena.dgac.fr/~pmoreau/
===============================================================================


