libfuse3-0.2.0.1: A Haskell binding for libfuse-3.x
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.LibFuse3.FileStat

Description

struct stat in Haskell.

Synopsis

Documentation

data FileStat Source #

A file status a.k.a. metadata.

The differences from FileStatus are:

  • Is a record type with a Storable instance.
  • Has an extra field blockCount.

    • An equivalent accessor fileBlocks was added in unix-2.8.0.0, but it is a Maybe.
  • Provides an exact representation (TimeSpec) of the time fields without converting to POSIXTime.

    • This assumes that the struct stat has st_atim, st_mtim and st_ctim fields. On Linux this requires Linux >= 2.6.

Ptr FileStat can be cast to Ptr CStat and vice versa.

Use defaultFileStat and modify its fields you are interested in.

The st_ino field is ignored unless the use_ino mount option is given.

The st_dev and st_blksize fields are ignored by libfuse, so not provided.

Constructors

FileStat 

Fields

defaultFileStat :: FileStat Source #

The default value of FileStat.

The Haskell Equivalent of zero-setting C code { struct stat st; memset(&st, 0, sizeof(struct stat)); }.

getFileStat :: FilePath -> IO FileStat Source #

Reads a file status of a given file.

Calls lstat.

getFileStatFd :: Fd -> IO FileStat Source #

Reads a file status of a given file.

Calls fstat.