Module

Node.FS.Sync

Package
purescript-node-fs
Repository
purescript-node/purescript-node-fs

#rename Source

rename :: forall eff. FilePath -> FilePath -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Renames a file.

#truncate Source

truncate :: forall eff. FilePath -> Int -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Truncates a file to the specified length.

#chown Source

chown :: forall eff. FilePath -> Int -> Int -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Changes the ownership of a file.

#chmod Source

chmod :: forall eff. FilePath -> Perms -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Changes the permissions of a file.

#stat Source

stat :: forall eff. FilePath -> Eff (exception :: EXCEPTION, fs :: FS | eff) Stats

Gets file statistics.

#realpath Source

realpath :: forall eff. FilePath -> Eff (exception :: EXCEPTION, fs :: FS | eff) FilePath

Find the canonicalized absolute location for a path.

#realpath' Source

realpath' :: forall cache eff. FilePath -> Record cache -> Eff (exception :: EXCEPTION, fs :: FS | eff) FilePath

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

#rmdir Source

rmdir :: forall eff. FilePath -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Deletes a directory.

#mkdir Source

mkdir :: forall eff. FilePath -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Makes a new directory.

#mkdir' Source

mkdir' :: forall eff. FilePath -> Perms -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Makes a new directory with the specified permissions.

#readdir Source

readdir :: forall eff. FilePath -> Eff (exception :: EXCEPTION, fs :: FS | eff) (Array FilePath)

Reads the contents of a directory.

#utimes Source

utimes :: forall eff. FilePath -> DateTime -> DateTime -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Sets the accessed and modified times for the specified file.

#readFile Source

readFile :: forall eff. FilePath -> Eff (exception :: EXCEPTION, fs :: FS | eff) Buffer

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

#readTextFile Source

readTextFile :: forall eff. Encoding -> FilePath -> Eff (exception :: EXCEPTION, fs :: FS | eff) String

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

#writeFile Source

writeFile :: forall eff. FilePath -> Buffer -> Eff (buffer :: BUFFER, exception :: EXCEPTION, fs :: FS | eff) Unit

Writes a buffer to a file.

#writeTextFile Source

writeTextFile :: forall eff. Encoding -> FilePath -> String -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Writes text to a file using the specified encoding.

#appendFile Source

appendFile :: forall eff. FilePath -> Buffer -> Eff (buffer :: BUFFER, exception :: EXCEPTION, fs :: FS | eff) Unit

Appends the contents of a buffer to a file.

#appendTextFile Source

appendTextFile :: forall eff. Encoding -> FilePath -> String -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

Appends text to a file using the specified encoding.

#exists Source

exists :: forall eff. FilePath -> Eff (fs :: FS | eff) Boolean

Check if the path exists.

#fdOpen Source

fdOpen :: forall eff. FilePath -> FileFlags -> Maybe FileMode -> Eff (exception :: EXCEPTION, fs :: FS | eff) FileDescriptor

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

#fdRead Source

fdRead :: forall eff. FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Eff (buffer :: BUFFER, exception :: EXCEPTION, fs :: FS | eff) ByteCount

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

#fdNext Source

fdNext :: forall eff. FileDescriptor -> Buffer -> Eff (buffer :: BUFFER, exception :: EXCEPTION, fs :: FS | eff) ByteCount

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

#fdWrite Source

fdWrite :: forall eff. FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Eff (buffer :: BUFFER, exception :: EXCEPTION, fs :: FS | eff) ByteCount

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

#fdAppend Source

fdAppend :: forall eff. FileDescriptor -> Buffer -> Eff (buffer :: BUFFER, exception :: EXCEPTION, fs :: FS | eff) ByteCount

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

#fdFlush Source

fdFlush :: forall eff. FileDescriptor -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

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

#fdClose Source

fdClose :: forall eff. FileDescriptor -> Eff (exception :: EXCEPTION, fs :: FS | eff) Unit

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