5 * Revision 1.5 1997/11/05 11:05:35 mclareni
6 * Remove malloc and free, which caused optimisation problems on NT; should be faster on Unix too.
8 * Revision 1.4 1997/10/23 16:33:20 mclareni
11 * Revision 1.3 1997/09/02 14:26:47 mclareni
14 * Revision 1.2 1997/02/20 16:41:48 gunter
15 * Mods for WNT; ie. transcribe the mods done to stati.c for WNT.
17 * Revision 1.1 1996/10/16 12:57:35 cernlib
18 * Add cfstat. cfstati is used by cfstat. This uses rfio_stat if CERNLIB_SHIFT
26 /*#pragma optimize( "", off ) */
29 #include "kerngen/pilot.h"
31 * CERN PROGLIB# Z310 CFSTATI
32 * ORIG. stolen with mods from stati.c, 11-Oct-96; GF.
33 * Routine used by cfstat; interface to stat or rfio_stat ( if shift software
37 #if defined(CERNLIB_QMVAX)||defined(CERNLIB_QMOS9)
41 #if (!defined(CERNLIB_QMVAX))&&(!defined(CERNLIB_QMOS9))
43 #include <sys/types.h>
45 #include "kerngen/cf_xaft.h"
47 # include <sys\types.h>
48 # include <sys\stat.h>
50 #include "kerngen/fortchar.h"
52 #include "kerngen/fortranc.h"
53 #if defined(CERNLIB_QX_SC)
54 int type_of_call cfstati_(fname, info, lgname)
56 #if defined(CERNLIB_QXNO_SC)
57 int type_of_call cfstati(fname, info, lgname)
59 #if defined(CERNLIB_QXCAPT)
60 #ifndef CERNLIB_MSSTDCALL
61 int type_of_call CFSTATI(fname, info, lgname)
63 int type_of_call CFSTATI(fname, lfname, info, lgname )
67 #if defined(CERNLIB_QMCRY)
70 #if !defined(CERNLIB_QMCRY)
78 char *ptname, *fchtak();
81 ptname = fchtak(fname,*lgname);
82 if (ptname == NULL) return -1;
85 #if defined(CERNLIB_PROJSHIFT)
87 istat = rfio_stat(ptname, &buf);
91 istat = stat(ptname, &buf);
96 info[0] = (int) buf.st_dev;
97 info[1] = (int) buf.st_ino;
98 info[2] = (int) buf.st_mode;
99 info[3] = (int) buf.st_nlink;
100 info[4] = (int) buf.st_uid;
101 info[5] = (int) buf.st_gid;
102 info[6] = (int) buf.st_size;
103 info[7] = (int) buf.st_atime;
104 info[8] = (int) buf.st_mtime;
105 info[9] = (int) buf.st_ctime;
106 #if defined(CERNLIB_QMDOS)||defined(CERNLIB_QMVAX)||defined(CERNLIB_QMOS9) \
107 ||defined(CERNLIB_WINNT)
111 info[10] = (int) buf.st_blksize;
112 info[11] = (int) buf.st_blocks;
120 /*> END <----------------------------------------------------------*/