From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/fio/finfo.x | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sys/fio/finfo.x (limited to 'sys/fio/finfo.x') diff --git a/sys/fio/finfo.x b/sys/fio/finfo.x new file mode 100644 index 00000000..898b354b --- /dev/null +++ b/sys/fio/finfo.x @@ -0,0 +1,46 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include +include + +.help finfo +.nf ___________________________________________________________________________ +FINFO -- Return information on the named file (directory entry). +See for a definition of the contents of the output structure. + +The times are returned in units of seconds from midnight on Jan 1, 1980, +local standard time. Use CTIME to convert the integer time into a character +string. The owner name is returned as a character string (stored as chars +in the long integer finfo array). The owner permissions are bits 1-2 of the +FI_PERM field, group permissions are bits 3-4, world bits 5-6. The meaning +of the bits are RW (read, write). Execute permission is indicated by a +file type. Note that the file size is returned in BYTES, rather than chars +(bytes are more desirable for directory listings). + +Call ZFPROT to determine if a file has delete permission. Call ACCESS to +determine if a "regular" file is of type text or binary. This information +requires additional expense to obtain on some systems, is not required for +a simple directory listing, and hence is not provided by FINFO. +.endhelp ______________________________________________________________________ + +int procedure finfo (fname, ostruct) + +char fname[ARB] +long ostruct[LEN_FINFO] +int status +include + +begin + iferr (call fmapfn (fname, pathname, SZ_PATHNAME)) + return (ERR) + + call zfinfo (pathname, ostruct, status) + + # ZFINFO returns the file owner string as a packed string. + if (status != ERR) + call strupk (FI_OWNER(ostruct), FI_OWNER(ostruct), FI_SZOWNER) + + return (status) +end -- cgit