Module

Node.FS.Sync

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

#rename Source

rename :: FilePath -> FilePath -> Effect Unit

Renames a file.

#truncate Source

truncate :: FilePath -> Int -> Effect Unit

Truncates a file to the specified length.

#chown Source

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

Changes the ownership of a file.

#chmod Source

chmod :: FilePath -> Perms -> Effect Unit

Changes the permissions of a file.

#stat Source

stat :: FilePath -> Effect Stats

Gets file statistics.

#realpath Source

realpath :: FilePath -> Effect FilePath

Find the canonicalized absolute location for a path.

#realpath' Source

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 Source

rmdir :: FilePath -> Effect Unit

Deletes a directory.

#mkdir Source

mkdir :: FilePath -> Effect Unit

Makes a new directory.

#mkdir' Source

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

Makes a new directory with the specified permissions.

#readdir Source

readdir :: FilePath -> Effect (Array FilePath)

Reads the contents of a directory.

#utimes Source

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

Sets the accessed and modified times for the specified file.

#readFile Source

readFile :: FilePath -> Effect Buffer

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

#readTextFile Source

readTextFile :: Encoding -> FilePath -> Effect String

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

#writeFile Source

writeFile :: FilePath -> Buffer -> Effect Unit

Writes a buffer to a file.

#writeTextFile Source

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

Writes text to a file using the specified encoding.

#appendFile Source

appendFile :: FilePath -> Buffer -> Effect Unit

Appends the contents of a buffer to a file.

#appendTextFile Source

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

Appends text to a file using the specified encoding.

#exists Source

exists :: FilePath -> Effect Boolean

Check if the path exists.

#fdOpen Source

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

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

#fdRead Source

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

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

#fdNext Source

fdNext :: FileDescriptor -> Buffer -> Effect ByteCount

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

#fdWrite Source

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

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

#fdAppend Source

fdAppend :: FileDescriptor -> Buffer -> Effect ByteCount

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

#fdFlush Source

fdFlush :: FileDescriptor -> Effect Unit

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

#fdClose Source

fdClose :: FileDescriptor -> Effect Unit

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