Module

Node.FS.Async

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

#Callback Source

type Callback a = Either Error a -> Effect Unit

Type synonym for callback functions.

#rename Source

rename :: FilePath -> FilePath -> Callback Unit -> Effect Unit

Renames a file.

#truncate Source

truncate :: FilePath -> Int -> Callback Unit -> Effect Unit

Truncates a file to the specified length.

#chown Source

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

Changes the ownership of a file.

#chmod Source

chmod :: FilePath -> Perms -> Callback Unit -> Effect Unit

Changes the permissions of a file.

#stat Source

stat :: FilePath -> Callback Stats -> Effect Unit

Gets file statistics.

#realpath Source

realpath :: FilePath -> Callback FilePath -> Effect Unit

Find the canonicalized absolute location for a path.

#realpath' Source

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

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

#rmdir Source

rmdir :: FilePath -> Callback Unit -> Effect Unit

Deletes a directory.

#mkdir Source

mkdir :: FilePath -> Callback Unit -> Effect Unit

Makes a new directory.

#mkdir' Source

mkdir' :: FilePath -> Perms -> Callback Unit -> Effect Unit

Makes a new directory with the specified permissions.

#readdir Source

readdir :: FilePath -> Callback (Array FilePath) -> Effect Unit

Reads the contents of a directory.

#utimes Source

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

Sets the accessed and modified times for the specified file.

#readFile Source

readFile :: FilePath -> Callback Buffer -> Effect Unit

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

#readTextFile Source

readTextFile :: Encoding -> FilePath -> Callback String -> Effect Unit

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

#writeFile Source

writeFile :: FilePath -> Buffer -> Callback Unit -> Effect Unit

Writes a buffer to a file.

#writeTextFile Source

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

Writes text to a file using the specified encoding.

#appendFile Source

appendFile :: FilePath -> Buffer -> Callback Unit -> Effect Unit

Appends the contents of a buffer to a file.

#appendTextFile Source

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

Appends text to a file using the specified encoding.

#exists Source

exists :: FilePath -> (Boolean -> Effect Unit) -> Effect Unit

Check if the path exists.

#fdOpen Source

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

Open a file asynchronously. See the Node Documentation for details.

#fdRead Source

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

Read from a file asynchronously. See the Node Documentation for details.

#fdNext Source

fdNext :: FileDescriptor -> Buffer -> Callback ByteCount -> Effect Unit

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

#fdWrite Source

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

Write to a file asynchronously. See the Node Documentation for details.

#fdAppend Source

fdAppend :: FileDescriptor -> Buffer -> Callback ByteCount -> Effect Unit

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

#fdClose Source

fdClose :: FileDescriptor -> Callback Unit -> Effect Unit

Close a file asynchronously. See the Node Documentation for details.