File attribute support
z/TPF file system file attributes are supported on a per file or per directory level. The syntax of the file attributes is in the format of name=value, where name is the name of the file attribute and value is the value of the attribute.
System recognized file attributes
The File attribute names table lists the system recognized file attribute names in the cfattr.h header file. You can change or display data that is associated with the names of file attributes by using the ZFILE attr command and functions such as tpf_getFileAttribute. However, you cannot delete system file attributes. The case and spelling of the attribute that you enter must match the attribute as it is defined in the cfattr.h header file, which is shown in the File attribute names table. You can use the ZFILE attr command to change the file attributes on the system.
| File attribute names |
|---|
| backup collection |
| control record id |
| data record id |
| ddname |
| dir size max |
| directory record id |
| file size max |
| index record id |
| search restrict |
| servicelevel |
| shadow collections |
| write restrict |
- The file size max attribute is enforced on write operations, so you can set the maximum sizes of
the file to values that are smaller than the actual size of the file. The dir size max attribute is
enforced when you add an entry to a directory, so you can set the maximum number of the directory to
values that are smaller than the number of actual directory entries in a directory. An addition to
the file or directory fails unless the actual sizes are reduced before the addition. However, if no
more additions are attempted, the file or directory remains at their current size.
The dir size max attribute is not inherited from a parent directory to child directories or files. The file size max attribute is inherited from a parent directory to child files and directories, but the file size max attribute has no effect on the directories.
- A file or directory can have only those attributes that are supported by the system at the time that the file or directory was created. For example, a file that was created before the write restrict attribute support was provided does not have the write restrict attribute.
- The search restrict and write restrict attributes are inherited from the parent
directory. You can set those attributes once on the root directory of a subtree; all newly created
children of the subtree inherit the attributes. In general, inheritance of file attributes is not
retroactive. That is, if a child directory is created before an attribute is set on the parent
directory, the child directory and the child subtrees are not set with the attribute. The
inheritance of the write restrict or search restrict attribute is not retroactive either.Note: Do not specify a value of TPF_RSTR or TPF_BPAS for the search restrict or write restrict file attribute. These values are reserved for IBM® use.
- In general the attributes for all file systems are not maintained when you use tax/par or FTP or when you copy or move files or directories from one file system to another, whether on the z/TPF system or not.
- For the z/TPF collection support file system (TFS), the search restrict attribute is maintained by TPF_FS_INODE_SEARCHRESTRICT_VERSION and later versions.
| File attribute name | IfileAttibute field name | Supporting file system |
|---|---|---|
| backup collection | NA | TFS |
| data record id | DataRecID | TFS, FFS, PFS |
| directory record id | DirRecID | TFS |
| dir size max | DirSizeMax | TFS, FFS, PFS,MFS |
| servicelevel | fileServiceLevel | FFS, PFS |
| file size max | FileSizeMax | TFS, FFS, PFS,MFS |
| index record id | IndexRecID | TFS |
| control record id | ObjRecID | TFS |
| shadow collections | ShadowCollections | TFS |
| ddname | to2ddnamePtr | TFS |
| write restrict | WriteRestrict | TFS, MFS, VCFX |
| search restrict | SearchRestrict | TFS, MFS, VCFX |
The following table shows the maximum size of the file and the maximum number of the directory that you can set on different file systems. It also shows whether the size maximum attribute can be set.
| File system | FileSizeMax | DirSizeMax | Pre-SizeMax I-node | Post-SizeMax I-node (new file) |
|---|---|---|---|---|
| TFS | INT_MAX | INT_MAX | Not settable | Settable |
| FFS | INT_MAX | INT_MAX | Settable (upgraded) | Settable |
| PFS | INT_MAX | INT_MAX | Settable (upgraded) | Settable |
| MFS | INT_MAX | INT_MAX | Settable (upgraded) | Settable |
The following table shows values that you can or cannot set for the backup collection, dir size max, file size max, shadow collections, write restrict, and search restrict attributes.
| backup collection | dir size max | file size max | shadow collections | write restrict | search restrict | |
|---|---|---|---|---|---|---|
| Default values | 0 | File system dependent maximum | File system dependent maximum | 0 | Not set or NULL | Not set or NULL |
| IfileAttribute struct if no change is desired | NA -- The attribute cannot be specified | 0 | 0 | 0 | NULL | NULL |
| IfileAttribute struct if change is desired | NA -- The attribute cannot be specified | 3 – File system dependent maximum | 1 – File system dependent maximum | 1 | Null-terminated string that consists of eight printable characters | Null-terminated string that consists of eight printable characters |
| Values that are not acceptable | Any value that is not < 0, 1 > | < 0, 1, 2 > File system dependent maximum | < 0 > File system dependent maximum | Any value that is not < 0, 1 > | Strings that are not eight characters in length or that contain non-printable characters | Strings that are not eight characters in length or that contain non-printable characters |
The following table shows the differences between the backup collection and shadow collections attributes.
| Description | backup collection | shadow collections |
|---|---|---|
| Supported for directories | Y | Y |
| Supported for files | N | Y |
| Changeable at creation time | N | Y |
| Changeable after creation | Y | N |