The stat structure of the system calls stat() and fstat() supplies all the important information about a POSIX file. This information is, among other things, also evaluated and edited by the POSIX command ls.
In the case of bs2fs files there are a few special features, and these are listed in the table below.
In some cases this information differs depending on whether the file is currently open or closed. When it is open, the file resides in the bs2fs container as a "shadow file".
stat() enables the information to be called for both closed and open objects, fstat() only for closed objects.
Information for closed bs2fs object | Information for opened bs2fs object | |
| Unique number between a bs2fs mount and umount | |
| Unique number of the bs2fs file system in which the file identified with st_ino resides. | |
| In the case of DMS files: "normally" 1 | |
| DMS file: | Size of the shadow file in the container |
| bs2-POSIX-user | |
| bs2-POSIX-group | |
| Attributes of the BS2000 file or library | Attributes of the shadow file in the |
| Attributes of the BS2000 file or library element |
Explanation of the time stamps
When an object is opened in read mode, the BS2000 file's time stamp is updated in the context of the BS2000 close operation, which takes place immediately after the shadow file has been copied into the container, which may be necessary. During read accesses in the container, the time stamp is updated following every read access to the shadow file. The time stamps of the BS2000 and shadow files then differ, i.e. the BS2000 file always has an "older" atime status than the shadow file. (While the file is open, the application only ever sees the shadow file's time stamp. After the close(), however, it sees the "older" time stamp of the BS2000 file again.) No access time stamp is normally maintained for library elements; the st_atime field then contains the library's access time stamp. Only if the maintenance of access time stamps was defined for the library using the LMS statement //MODIFY-LIBRARY-ATTRIBUTES with the ACCES-DATE=*KEEP operand or with the corresponding LMSUP function will the access time stamps for its elements be updated from this point, and they can then be transferred to the st_atime field.
The st_ctime field for the file status is not changed after chmod(); as for BS2000 files, st_ctime represents the creation time (CREATION TIME in FSTAT). |