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.

#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.

#mkdir

mkdir :: FilePath -> Effect Unit

Makes a new directory.

#mkdir'

mkdir' :: FilePath -> Perms -> 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