Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

fstat, stat - bs2fs file structure

&pagelevel(4)&pagelevel

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
(stat)

Information for opened bs2fs object
(stat or fstat)

st_ino

Unique number between a bs2fs mount and umount

st_dev

Unique number of the bs2fs file system in which the file identified with st_ino resides.

st_nlink

In the case of DMS files: "normally" 1
In the case of library elements with highest version: 2
In the case of other library elements:1

st_size

DMS file:
last written PAM page in bytes
Library element:
size of PAM pages in bytes

Size of the shadow file in the container

st_uid

bs2-POSIX-user

st_gid

bs2-POSIX-group

st_atime
st_mtime
st_ctime

Attributes of the BS2000 file or library
element
In the case of library elements st_atime has
the same value as in the library or an
element-specific value if LMS is activated

Attributes of the shadow file in the
container

st_mode

Attributes of the BS2000 file or library element


Explanation of the time stamps

st_atime

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.

st_ctime

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).