User Tools

Site Tools


DzFileInfo

DAZ Script file information class.

More...

Inherits :

Inherited By : DzFile, DzGZFile and DzZipFile

Enumerations

Constructors

DAZ Script
DzFileInfo ( String file )

Methods

Detailed Description

Provides access to getting information about files. It also serves as the base class for the other DAZ Script File I/O types.

Enumerations


: Permissions

Enumerated values used by permission() and permissions() to set/report the permissions and/or ownership of a file. The values may be OR-ed together to set/test multiple permissions and ownership values.

  • ReadOwner - The file is readable by the owner of the file.
  • WriteOwner - The file is writable by the owner of the file.
  • ExeOwner - The file is executable by the owner of the file.
  • ReadUser - The file is readable by the user.
  • WriteUser - The file is writable by the user.
  • ExeUser - The file is executable by the user.
  • ReadGroup - The file is readable by the group.
  • WriteGroup - The file is writable by the group.
  • ExeGroup - The file is executable by the group.
  • ReadOther - The file is readable by anyone.
  • WriteOther - The file is writable by anyone.
  • ExeOther - The file is executable by anyone.

Constructors


DzFileInfo( String file )

Creates a file info object to retrieve information about the given file.

Parameter(s):

  • file - The path of the file.

Methods


DzDir : absoluteDir()

Return Value:

  • The file's absolute path as a DzDir object.

Since:

  • 4.9.3.35

String : absoluteFilePath()

Return Value:

  • The absolute path of the file, including the file name.

Since:

  • 4.9.3.29

String : absolutePath()

Return Value:

  • The absolute path of the file, excluding the file name.

Since:

  • 4.9.3.29

String : bundleName()

Return Value:

  • On Mac OS X, the proper localized name for a bundle if the path isBundle(). On all other platforms an empty string.

Since:

  • 4.9.3.29

Boolean : caching()

Return Value:

  • true if caching is enabled, otherwise false.

Since:

  • 4.9.3.29

String : canonicalFilePath()

Return Value:

  • The canonical path including the file name, i.e. an absolute path without symbolic links or redundant “.” or “..” elements. If the file does not exist, returns an empty string.

Since:

  • 4.9.3.29

String : canonicalPath()

Return Value:

  • The canonical path excluding the file name, i.e. an absolute path without symbolic links or redundant “.” or “..” elements. If the file does not exist, returns an empty string.

Since:

  • 4.9.3.29

String : completeBaseName()

Return Value:

  • The file name excluding the last '.' and extension.

Since:

  • 4.9.3.29

String : completeSuffix()

Return Value:

  • All characters in the file name after (but not including) the first “.”.

Since:

  • 4.9.3.29

Date : created()

Return Value:

  • The date and time the file was created.

DzDir : dir()

Return Value:

  • The path of the object's parent directory as a DzDir object.

Since:

  • 4.9.3.35

Boolean : exists()

Return Value:

  • true if the file exists on the disk.

String : fileName()

Return Value:

  • The name of the file, excluding the path.

String : filePath()

Return Value:

  • The file name, including the path (which may be absolute or relative).

Since:

  • 4.9.3.29

Boolean : isAbsolute()

Return Value:

  • true if the file path is absolute, otherwise false.

Since:

  • 4.9.3.29

Boolean : isBundle()

Return Value:

  • true if this object points to a bundle or to a symbolic link to a bundle on Mac OS X, otherwise false.

Since:

  • 4.9.3.29

Boolean : isDir()

Return Value:

  • true if this object points to a directory or to a symbolic link to a directory, otherwise false.

Since:

  • 4.9.3.29

Boolean : isExecutable()

Return Value:

  • true if this object points to file that is executable, otherwise false.

Since:

  • 4.9.3.29

Boolean : isFile()

Return Value:

  • true if this object points to a file or to a symbolic link to a file, otherwise false (e.g., a directory).

Since:

  • 4.9.3.29

Boolean : isHidden()

Return Value:

  • true if the file is 'hidden', otherwise false.

Boolean : isReadable()

Return Value:

  • true if the file is readable by the user, otherwise false.

Boolean : isRelative()

Return Value:

  • true if the file path is relative, otherwise false.

Since:

  • 4.9.3.29

Boolean : isRoot()

Return Value:

  • true if the object points to a directory or to a symbolic link to a directory, and that directory is the root directory, otherwise false.

Since:

  • 4.9.3.29

Boolean : isSymLink()

Return Value:

  • true if this object points to a symbolic link (shortcut on Windows), otherwise false.

Since:

  • 4.9.3.29

Boolean : isWritable()

Return Value:

  • true if the file is writable by the user, otherwise false.

Date : lastModified()

Return Value:

  • The date and time the file was last modified.

Date : lastRead()

Return Value:

  • The date and time the file was last accessed.

Boolean : makeAbsolute()

Converts the file's path to an absolute path if it is not already in that form.

Return Value:

  • true if the path was converted, otherwise false.

Since:

  • 4.9.3.29

String : path()

Return Value:

  • The absolute path of the file.

See Also:


Boolean : permission( Permissions permissions )

Tests for file permissions. The permissions argument can be several Permissions OR-ed together to check for permission combinations.

Return Value:

  • true if the file has the permissions specified, otherwise false.

Since:

  • 4.9.3.35

Permissions : permissions()

Return Value:

  • The complete OR-ed together combination of Permissions for the file.

Since:

  • 4.9.3.29

void : refresh()

Refreshes information about the file, i.e. reads in information from the file system the next time a cached property is fetched.

Since:

  • 4.9.3.29

Boolean : remove()

Delete the file from the disk.

Return Value:

  • true if successful, otherwise false.

void : setCaching( Boolean enable )

Sets whether or not caching of file information caching is enabled. When caching is enabled, file information is read from the file system the first time it's needed, but generally not later.

Since:

  • 4.9.3.29

void : setFile( String file )

Sets the file to provide information about to file.

Since:

  • 4.9.3.29

void : setFile( DzDir dir, String file )

Sets the file to provide information about to file in dir.

Since:

  • 4.9.3.29

void : setFile( DzFile file )

Sets the file to provide information about to file.

Since:

  • 4.9.3.29

Number : size()

Return Value:

  • The file size in bytes. If the file does not exist or cannot be fetched, 0 is returned.

String : sizeStr()

Return Value:

  • The file size in bytes, formatted in an easy-to-read manner.

See Also:


String : suffix()

Return Value:

  • All characters in the file after, but not including, the last '.'.

Since:

  • 4.9.3.29

String : symLinkTarget()

Return Value:

  • The absolute path that the file or directory a symbolic link (shortcut on Windows) points to, or a an empty string if the object is not a symbolic link.

Since:

  • 4.9.3.29

String : absFileName()

Deprecated

Exists only to keep old code working. Do not use in new code. Use absoluteFilePath() instead.


String : extension()

Deprecated

Exists only to keep old code working. Do not use in new code. Use suffix() instead.


String : baseName()

Deprecated

Exists only to keep old code working. Do not use in new code. Use completeBaseName() instead.