home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / flistfrontend / src / sydelete.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-21  |  945 b   |  50 lines

  1. #ifndef NO_IDENT
  2. static char *Id = "$Id: sydelete.c,v 1.4 1995/10/21 18:39:13 tom Exp $";
  3. #endif
  4.  
  5. /*
  6.  * Title:    sysdelete.c
  7.  * Author:    Thomas E. Dickey
  8.  * Created:    22 May 1985
  9.  * Last update:
  10.  *        03 Jun 1995, prototyped
  11.  *
  12.  * Function:    delete a file, given its file-specification
  13.  *
  14.  * Parameters:    dspec    = file-specification string
  15.  *
  16.  * Returns:    nonzero VMS status value iff an error is detected.
  17.  */
  18.  
  19. #include    <starlet.h>
  20. #include    <rms.h>
  21. #include    <stsdef.h>
  22.  
  23. #include    "rmsinit.h"
  24.  
  25. #include    "sysutils.h"
  26.  
  27. #define    ok(x)     status = x; if (!$VMS_STATUS_SUCCESS(status)) return(status)
  28.  
  29. unsigned sysdelete (char *dspec)
  30. {
  31.     struct    FAB    dFAB;
  32.     struct    NAM    dNAM;
  33.     unsigned status;
  34.     int    len;
  35.     char    dRSA    [NAM$C_MAXRSS];
  36.     char    dESA    [NAM$C_MAXRSS];
  37.  
  38.     /*
  39.      * Check for the delete-name:
  40.      */
  41.     rmsinit_fab (&dFAB, &dNAM, 0, dspec);
  42.     rmsinit_nam (&dNAM, dRSA, dESA);
  43.  
  44.     ok(sys$parse(&dFAB));
  45.     ok(sys$search(&dFAB));
  46.     ok((sys$erase (&dFAB, 0,0)));
  47.  
  48.     return (0);
  49. }
  50.