gftp/list/file_type

This module contains the FileType type which provides information about the type of a file, such as whether it is a directory, a symbolic link, or a regular file.

Types

The FileType type represents the type of a file, which can be a regular file, a directory, or a symbolic link.

pub type FileType {
  File
  Directory
  Symlink(to: String)
}

Constructors

  • File

    A regular file.

  • Directory

    A directory.

  • Symlink(to: String)

    A symbolic link, which points to another file or directory.

Values

pub fn is_directory(file_type: FileType) -> Bool

Returns True if the file type is a directory, and False otherwise.

pub fn is_file(file_type: FileType) -> Bool

Returns True if the file type is a regular file, and False otherwise.

pub fn is_symlink(file_type: FileType) -> Bool

Returns True if the file type is a symbolic link, and False otherwise.

pub fn symlink(file_type: FileType) -> option.Option(String)

If the file type is a symbolic link, returns the target of the link. Otherwise, returns None.

Search Document