Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Methods for inquiring file and directory attributes

The exists() method checks whether the file or the directory exists in the file system. Many of the methods offered can only be used effectively if the file or directory exists and is visible (for example files are not always visible for the calling program in foreign user IDs).

Special features of the DMS file system

A file is regarded as existing if it has already been opened once. This means that a catalog entry for the existence of a file is not sufficient. A directory exists if the specified catalog ID and/or user ID is accessible in the file system.

The canRead() method checks whether the file or the directory for this object exists (in the sense of exists()) and is readable for the calling program.

Special features of the DMS file system

true is always returned for existing directories.

The canWrite() method checks whether the file or the directory for this object exists (in the sense of exists()) and is writable for the calling program.

Special features of the DMS file system

Always returns false for a directory consisting only of the catalog ID if the calling program is not privileged, also for foreign user IDs.

The isDirectory() method returns true if an existing directory in the associated file system is involved.

The isFile() method returns true if a normal file in the associated file system is involved. A file is normal if it is not a directory and also meets file-system-specific criteria (for example special files in UFS are not normal files). Every file generated by a Java application which is not a directory is guaranteed to be a normal file.

The isHidden() method can be used to determine whether the file or directory is hidden in the file system. What precisely hidden means is defined on a file-system-specific basis.

Special features of the DMS file system

Temporary files in the DMS sense are always regarded as hidden.

The lastModified() method returns the time of the last modification to the file or directory if the file system supports this.

Special features of the DMS file system

Directories do not have their own modification date. Consequently 0 is always returned.

The length() method returns the size of a file or directory. How the size of a directory is defined is file-system-specific.

Special features of the DMS file system

For files the number of used (not reserved) PAM pages in the file multiplied by 2048 is returned, and for directories always the value 0.

The getAccessParameter() method returns the parameters for accessing this file with the specified access method. The AccessParameter object returned can, for example, be used to generate a new file with the same parameters and is used internally for file access.

The static method getDefaultAccessParameter() returns the default parameters for the given access method in the given file system. The user can then, if required, modify these parameters and generate new files with them.

The getPreferredAccessMethod() method returns the name of the preferred access method for an existing file in the associated file system. It is not guaranteed that the file was generated with this access method, especially if the access methods in this file system are only a logical view of the file contents and not inquirable file attributes.

The getAllowedAccessMethods() method returns a list of the names of the permitted access methods for an existing file in the associated file system. It is not guaranteed that the file was generated with one of these access methods, especially if the access methods in this file system are only a logical view of the file contents and not inquirable file attributes.

The static method getAllAccessMethods() returns a list of the names of all the access methods supported in the specified file system.