stat, wstat - inquire or change file attributes — Inferno 1ed
stat, wstat - inquire or change file attributes
Tstat tag [2] fid [2] Rstat tag [2] fid [2] stat [116] Twstat tag [2] fid [2] stat [116] Rwstat tag [2] fid [2]
Description
The stat Transaction
The stat transaction inquires about the file identified by fid. The reply includes (in the stat argument) a directory entry containing the file's attributes.The stat request requires no special permissions other than those needed to acquire fid.
Directory Entry Layout
Both the stat and wstat messages transmit file attributes in a machine-independent representation called a directory entry.A directory entry is 116-bytes long. See DIRLEN in <lib9.h>. Integers in this encoding are in little-endian order (least significant byte first). The convM2D and convD2M routines (see ) convert between directory entries and C language structures.
This encoding may be turned into a machine dependent Dir structure using routines defined in styx.(see lib9.h)
A read of a directory yields an integral number of directory entries in the machine independent encoding given above (see read, write - transfer data from and to a file).
The wstat Transaction
The wstat request can change certain file attributes.
None of the other attributes can be altered by a wstat. In particular, there is no way to change the owner of a file.
Entry Points
Type stat messages are generated by the fstat and stat calls (see stat, fstat, fwstat, wstat - get and put file status in Chapter 8).
infernosupport@lucent.com Copyright © 1996,Lucent Technologies, Inc. All rights reserved.