File: unlink.hxx

package info (click to toggle)
omniorb 1%3A3.0.4.1-8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 13,024 kB
  • ctags: 19,172
  • sloc: cpp: 80,906; python: 17,895; ansic: 17,630; yacc: 3,441; lex: 1,306; sh: 1,191; xml: 871; perl: 383; makefile: 108; tcl: 18
file content (30 lines) | stat: -rw-r--r-- 683 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef unlink_hxx
#define unlink_hxx

#if defined(__VMS) && __VMS_VER < 70000000

//  provide unlink() functionality for VMS versions prior to 7.0

#include <errno.h>
#include <descrip.h>
#include <lib$routines.h>

static int unlink(char const* fileName) {

     dsc$descriptor_s dx;
     dx.dsc$w_length = strlen(fileName);
     dx.dsc$b_dtype = DSC$K_DTYPE_T;
     dx.dsc$b_class = DSC$K_CLASS_S;
     dx.dsc$a_pointer = (char*)fileName;	// VMS descriptors are not
						// const correct!
     vaxc$errno = lib$delete_file(&dx);
     int result = (vaxc$errno & 1) ? 0 : -1;
     if (result == -1) {
	errno = EVMSERR;
     }
     return result;

}
#endif	// VMS before 7.0

#endif