Module

Node.FS.Sync

#rename

rename :: FilePath -> FilePath -> Effect Unit

Renames a file.

#truncate

truncate :: FilePath -> Int -> Effect Unit

Truncates a file to the specified length.

#chown

chown :: FilePath -> Int -> Int -> Effect Unit

Changes the ownership of a file.

#chmod

chmod :: FilePath -> Perms -> Effect Unit

Changes the permissions of a file.

#stat

stat :: FilePath -> Effect Stats

Gets file statistics.

#lstat

lstat :: FilePath -> Effect Stats

Gets file or symlink statistics. lstat is identical to stat, except that if the FilePath is a symbolic link, then the link itself is stat-ed, not the file that it refers to.

#realpath

realpath :: FilePath -> Effect FilePath

Find the canonicalized absolute location for a path.

#realpath'

realpath' :: forall cache. FilePath -> Record cache -> Effect FilePath

Find the canonicalized absolute location for a path using a cache object for already resolved paths.

#rmdir

rmdir :: FilePath -> Effect Unit

Deletes a directory.

#rmdir'

rmdir' :: FilePath -> { maxRetries :: Int, retryDelay :: Int } -> Effect Unit

Deletes a directory with options.

#rm

rm :: FilePath -> Effect Unit

Deletes a file or directory.

#rm'

rm' :: FilePath -> { force :: Boolean, maxRetries :: Int, recursive :: Boolean, retryDelay :: Int } -> Effect Unit

Deletes a file or directory with options.

#mkdir

mkdir :: FilePath -> Effect Unit

Makes a new directory.

#mkdir'

mkdir' :: FilePath -> { mode :: Perms, recursive :: Boolean } -> Effect Unit

Makes a new directory with the specified permissions.

#readdir

readdir :: FilePath -> Effect (Array FilePath)

Reads the contents of a directory.

#utimes

utimes :: FilePath -> DateTime -> DateTime -> Effect Unit

Sets the accessed and modified times for the specified file.

#readFile

readFile :: FilePath -> Effect Buffer

Reads the entire contents of a file returning the result as a raw buffer.

#readTextFile

readTextFile :: Encoding -> FilePath -> Effect String

Reads the entire contents of a text file with the specified encoding.

#writeFile

writeFile :: FilePath -> Buffer -> Effect Unit

Writes a buffer to a file.

#writeTextFile

writeTextFile :: Encoding -> FilePath -> String -> Effect Unit

Writes text to a file using the specified encoding.

#appendFile

appendFile :: FilePath -> Buffer -> Effect Unit

Appends the contents of a buffer to a file.

#appendTextFile

appendTextFile :: Encoding -> FilePath -> String -> Effect Unit

Appends text to a file using the specified encoding.

#exists

exists :: FilePath -> Effect Boolean

Check if the path exists.

#fdOpen

fdOpen :: FilePath -> FileFlags -> Maybe FileMode -> Effect FileDescriptor

Open a file synchronously. See the Node documentation for details.

#fdRead

fdRead :: FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Effect ByteCount

Read from a file synchronously. See the Node documentation for details.

#fdNext

fdNext :: FileDescriptor -> Buffer -> Effect ByteCount

Convenience function to fill the whole buffer from the current file position.

#fdWrite

fdWrite :: FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Effect ByteCount

Write to a file synchronously. See the Node documentation for details.

#fdAppend

fdAppend :: FileDescriptor -> Buffer -> Effect ByteCount

Convenience function to append the whole buffer to the current file position.

#fdFlush

fdFlush :: FileDescriptor -> Effect Unit

Flush a file synchronously. See the Node documentation for details.

#fdClose

fdClose :: FileDescriptor -> Effect Unit

Close a file synchronously. See the Node documentation for details.

Modules