2 CERN PROGLIB# Z265 LSTATI .VERSION KERNFOR 4.38 931108
3 C ORIG. 24/03/91, RDM + JZ
4 Fortran interface routine to lstat
5 Version for Windows NT/Windows 95 by Valery Fine 30/05/96 (fine@vxcern.cern.ch)
12 #include <sys/types.h>
15 #include "kerngen/fortranc.h"
17 #if defined(CERNLIB_QX_SC)
18 int type_of_call lstati_(fname, info, lgname, slate)
20 #if defined(CERNLIB_QXNO_SC)
21 int type_of_call lstati(fname, info, lgname, slate)
23 #if defined(CERNLIB_QXCAPT)
24 int type_of_call LSTATI(fname, info, lgname, slate)
32 char *ptname, *fchtak();
36 ptname = fchtak(fname,*lgname);
37 if (ptname == NULL) goto out1;
39 buf = (struct _stat *) malloc(sizeof (struct _stat));
40 if (buf == NULL) goto out2;
42 istat = stat(ptname, buf);
45 info[0] = (int) buf->st_dev;
46 info[1] = (int) buf->st_ino;
47 info[2] = (int) buf->st_mode;
48 info[3] = (int) buf->st_nlink;
49 info[4] = (int) buf->st_uid;
50 info[5] = (int) buf->st_gid;
51 info[6] = (int) buf->st_size;
52 info[7] = (int) buf->st_atime;
53 info[8] = (int) buf->st_mtime;
54 info[9] = (int) buf->st_ctime;
57 *slate++ = (buf->st_mode & S_IFMT) ^ S_IFREG;
59 *slate++ = (buf->st_mode & S_IFMT) ^ S_IFDIR;
67 /*> END <----------------------------------------------------------*/