Skip to content

Latest commit

 

History

History
172 lines (114 loc) · 2.7 KB

File metadata and controls

172 lines (114 loc) · 2.7 KB

Node.FileSystem

FileSystem

defaultEncoding

defaultEncoding : Node.Encoding.Encoding

Default encoding (Utf8).


defaultMode

defaultMode : Node.FileSystem.Mode

Default mode (Read and Write access for Owner, Group, and Others).

Query

type alias Stats

type alias Stats  =  
    { type_ : Node.FileSystem.FileType , size : Int , mode : Node.FileSystem.Mode , accessed : Time , modified : Time , changed : Time , created : Time }

Path statistics.


type FileType

type FileType   
    = File   
    | Directory   
    | Socket   
    | SymbolicLink 

Path types.


exists

exists : String -> Task Node.Error.Error Bool

Check whether a path exists.


statistics

statistics : String -> Task Node.Error.Error Node.FileSystem.Stats

Get statistics for a given path.

Manage

copy

copy : Bool -> String -> String -> Task Node.Error.Error (Dict String (Result Node.Error.Error ()))

Copy a file or directory recursively.


mkdirp

mkdirp : String -> Task Node.Error.Error ()

Make a directory using the given directory name.

Non-existent directories in the path will be created.


remove

remove : String -> Task Node.Error.Error ()

Remove a file or directory recursively.


rename

rename : String -> String -> Task Node.Error.Error ()

Rename a file.


symbolicLink

symbolicLink : String -> String -> Task Node.Error.Error ()

Make a symbolic link.

Read

readFile

readFile : String -> Task Node.Error.Error Node.Buffer.Buffer

Read a file as a Buffer.


readFileAsString

readFileAsString : String -> Node.Encoding.Encoding -> Task Node.Error.Error String

Read a file as a string.

Write

writeFile

writeFile : String -> Node.FileSystem.Mode -> Node.Buffer.Buffer -> Task Node.Error.Error ()

Write a file from a Buffer.

Non-existent directories in the filename path will be created.


writeFileFromString

writeFileFromString : String -> Node.FileSystem.Mode -> Node.Encoding.Encoding -> String -> Task Node.Error.Error ()

Write a file from a String.

Non-existent directories in the file's path will be created.