Function Block FS_STAT

The function block FS_STAT returns the status of a path in the file system.

The file system must have been initialized beforehand using FS_INIT. All operations are performed asynchronously per storage medium created.

Input GET

A positive edge determines the status of the specified path.

Input DEV

Defines the device from which files should be accessed. The device is used per project and can be managed in the context menu under Project External Storage.

Input PATH

Specifies the path to the file or directory on the storage medium. The path corresponds to a Unix file path in UTF-8 format, if this is supported. The path is represented as follows:

Folder/Subfolder/File.txt

Input LINK

Indicates whether a link should be followed and the target evaluated.

Output DONE

The output returns a pulse upon success to perform the next operation. The pulse occurs when the process ends, even if an error has occurred.

Output DEVID

Returns the device number if it could be determined.

Output INODE

Returns the inode number.

Output MODE

Returns the access mode. The mode returns as octal the value of TYPE and PERM. The last three digits correspond to the permission.

Output TYPE

The output can take the following values:

Value Description
"link" Symlink
"file" File
"block" Block
"dir" Directory
"fifo" FIFO
"0##" Other Type

Output PERM

The file permission in UNIX format. For example, "0644".

Output NLINK

Returns the number of links.

Output UID

Returns the user ID.

Output GID

Returns the group ID.

Output RDEV

Returns the device type if it is an inode device.

Output SIZE

Returns the file size in bytes.

Output ATIME

Returns the timestamp in DT# format of the last access. If the value is not present, 0 is returned or -1 if the protocol does not support the value.

Output MTIME

Returns the timestamp in DT# format of the last modification. If the value is not present, 0 is returned or -1 if the protocol does not support the value.

Output CTIME

Returns the timestamp in DT# format of the last modification of the inode. If the value is not present, 0 is returned or -1 if the protocol does not support the value.

Output BLKSIZE

Returns the block size of the file system. If the value is not present, 0 is returned or -1 if the protocol does not support the value.

Output BLOCKS

Returns the number of blocks used by the file system. If the value is not present, 0 is returned or -1 if the protocol does not support the value.

Output ERROR

In case of an error, returns a text with an error message. This is FALSE if no error has occurred. The state is stored for later use.

Possible causes:

  • The service of the storage medium was not started.
  • The memory was not initialized.
  • The login credentials are invalid.
  • The remote server could not be reached.
  • The storage medium does not exist.
  • The specified path is invalid.