LanguageExt.Sys

LanguageExt.Sys Sys IO

Contents

class Directory <M, RT> Source #

where M : Monad<M>
where RT : Has<M, DirectoryIO>

Properties

property K<M, string> current Source #

Get the current directory

property K<M, Seq<string>> logicalDrives Source #

Get the logical drives

Methods

method K<M, DirectoryInfo> create (string path) Source #

Create a directory

method K<M, Unit> delete (string path, bool recursive = true) Source #

Delete a directory

method K<M, Option<DirectoryInfo>> getParent (string path) Source #

Get parent directory

method K<M, bool> exists (string path) Source #

Check if directory exists

method K<M, Unit> setCreationTime (string path, DateTime creationTime) Source #

Set the directory creation time

method K<M, Unit> setCreationTimeUtc (string path, DateTime creationTimeUtc) Source #

Set the directory creation time

method K<M, DateTime> getCreationTime (string path) Source #

Get the directory creation time

method K<M, DateTime> getCreationTimeUtc (string path) Source #

Get the directory creation time

method K<M, Unit> setLastWriteTime (string path, DateTime lastWriteTime) Source #

Set the directory last write time

method K<M, Unit> setLastWriteTimeUtc (string path, DateTime lastWriteTimeUtc) Source #

Set the directory last write time

method K<M, DateTime> getLastWriteTime (string path) Source #

Get the directory last write time

method K<M, DateTime> getLastWriteTimeUtc (string path) Source #

Get the directory last write time

method K<M, Unit> setLastAccessTime (string path, DateTime lastAccessTime) Source #

Set the directory last access time

method K<M, Unit> setLastAccessTimeUtc (string path, DateTime lastAccessTimeUtc) Source #

Set the directory last access time

method K<M, DateTime> getLastAccessTime (string path) Source #

Get the directory last access time

method K<M, DateTime> getLastAccessTimeUtc (string path) Source #

Get the directory last access time

method K<M, Seq<string>> enumerateDirectories (string path) Source #

Enumerate directories

method K<M, Seq<string>> enumerateDirectories (string path, string searchPattern) Source #

Enumerate directories

method K<M, Seq<string>> enumerateDirectories (string path, string searchPattern, SearchOption searchOption) Source #

Enumerate directories

method K<M, Seq<string>> enumerateFiles (string path) Source #

Enumerate files

method K<M, Seq<string>> enumerateFiles (string path, string searchPattern) Source #

Enumerate files

method K<M, Seq<string>> enumerateFiles (string path, string searchPattern, SearchOption searchOption) Source #

Enumerate files

method K<M, Seq<string>> enumerateFileSystemEntries (string path) Source #

Enumerate file system entries

method K<M, Seq<string>> enumerateFileSystemEntries (string path, string searchPattern) Source #

Enumerate file system entries

method K<M, Seq<string>> enumerateFileSystemEntries (string path, string searchPattern, SearchOption searchOption) Source #

Enumerate file system entries

method K<M, string> getRoot (string path) Source #

Get the root of the path provided

method K<M, Unit> setCurrent (string path) Source #

Set the current directory

Parameters

param path

method K<M, Unit> move (string sourceDirName, string destDirName) Source #

Move a directory

class Directory <RT> Source #

where RT : Has<Eff<RT>, DirectoryIO>

Properties

property Eff<RT, string> current Source #

Get the current directory

property Eff<RT, Seq<string>> logicalDrives Source #

Get the logical drives

Methods

method Eff<RT, DirectoryInfo> create (string path) Source #

Create a directory

method Eff<RT, Unit> delete (string path, bool recursive = true) Source #

Delete a directory

method Eff<RT, Option<DirectoryInfo>> getParent (string path) Source #

Get parent directory

method Eff<RT, bool> exists (string path) Source #

Check if directory exists

method Eff<RT, Unit> setCreationTime (string path, DateTime creationTime) Source #

Set the directory creation time

method Eff<RT, Unit> setCreationTimeUtc (string path, DateTime creationTimeUtc) Source #

Set the directory creation time

method Eff<RT, DateTime> getCreationTime (string path) Source #

Get the directory creation time

method Eff<RT, DateTime> getCreationTimeUtc (string path) Source #

Get the directory creation time

method Eff<RT, Unit> setLastWriteTime (string path, DateTime lastWriteTime) Source #

Set the directory last write time

method Eff<RT, Unit> setLastWriteTimeUtc (string path, DateTime lastWriteTimeUtc) Source #

Set the directory last write time

method Eff<RT, DateTime> getLastWriteTime (string path) Source #

Get the directory last write time

method Eff<RT, DateTime> getLastWriteTimeUtc (string path) Source #

Get the directory last write time

method Eff<RT, Unit> setLastAccessTime (string path, DateTime lastAccessTime) Source #

Set the directory last access time

method Eff<RT, Unit> setLastAccessTimeUtc (string path, DateTime lastAccessTimeUtc) Source #

Set the directory last access time

method Eff<RT, DateTime> getLastAccessTime (string path) Source #

Get the directory last access time

method Eff<RT, DateTime> getLastAccessTimeUtc (string path) Source #

Get the directory last access time

method Eff<RT, Seq<string>> enumerateDirectories (string path) Source #

Enumerate directories

method Eff<RT, Seq<string>> enumerateDirectories (string path, string searchPattern) Source #

Enumerate directories

method Eff<RT, Seq<string>> enumerateDirectories (string path, string searchPattern, SearchOption searchOption) Source #

Enumerate directories

method Eff<RT, Seq<string>> enumerateFiles (string path) Source #

Enumerate files

method Eff<RT, Seq<string>> enumerateFiles (string path, string searchPattern) Source #

Enumerate files

method Eff<RT, Seq<string>> enumerateFiles (string path, string searchPattern, SearchOption searchOption) Source #

Enumerate files

method Eff<RT, Seq<string>> enumerateFileSystemEntries (string path) Source #

Enumerate file system entries

method Eff<RT, Seq<string>> enumerateFileSystemEntries (string path, string searchPattern) Source #

Enumerate file system entries

method Eff<RT, Seq<string>> enumerateFileSystemEntries (string path, string searchPattern, SearchOption searchOption) Source #

Enumerate file system entries

method Eff<RT, string> getRoot (string path) Source #

Get the root of the path provided

method Eff<RT, Unit> setCurrent (string path) Source #

Set the current directory

Parameters

param path

method Eff<RT, Unit> move (string sourceDirName, string destDirName) Source #

Move a directory

class File <M, RT> Source #

where M : Monad<M>
where RT : Has<M, FileIO>, Has<M, EncodingIO>

File IO

Methods

method K<M, Unit> copy (string fromPath, string toPath, bool overwrite = false) Source #

Copy file

Parameters

type RT

Runtime

param fromPath

Source path

param toPath

Destination path

param overwrite

Overwrite if the file already exists at the destination

returns

Unit

method K<M, Unit> move (string fromPath, string toPath) Source #

Move file

Parameters

type RT

Runtime

param fromPath

Source path

param toPath

Destination path

returns

Unit

method K<M, Unit> move (string fromPath, string toPath, bool overwrite) Source #

Move file

Parameters

type RT

Runtime

param fromPath

Source path

param toPath

Destination path

param overwrite

Overwrite if the file already exists at the destination

returns

Unit

method K<M, Unit> appendAllLines (string path, IEnumerable<string> contents) Source #

Append lines to the end of the file provided

method K<M, Seq<string>> readAllLines (string path) Source #

Read all of the lines from the path provided

method K<M, Unit> writeAllLines (string path, Seq<string> lines) Source #

Write all of the lines to the path provided

method K<M, string> readAllText (string path) Source #

Read all of the text from the path provided

method K<M, byte[]> readAllBytes (string path) Source #

Read all of the data from the path provided

method K<M, Unit> writeAllText (string path, string text) Source #

Write all of the text to the path provided

method K<M, Unit> writeAllBytes (string path, byte[] data) Source #

Write all of the data to the path provided

method K<M, Unit> delete (string path) Source #

Delete the file provided

method K<M, bool> exists (string path) Source #

True if a file exists at the path

method Producer<TextReader, M, Unit> openText (string path) Source #

Open a text file

method K<M, TextWriter> createText (string path) Source #

Create a new text file to stream to

method K<M, TextWriter> appendText (string path) Source #

Return a stream to append text to

method Producer<Stream, M, Unit> openRead (string path) Source #

Open a file-stream

method Producer<Stream, M, Unit> open (string path, FileMode mode) Source #

Open a file-stream

method Producer<Stream, M, Unit> open (string path, FileMode mode, FileAccess access) Source #

Open a file-stream

method Producer<Stream, M, Unit> openWrite (string path) Source #

Open a file-stream

class File <RT> Source #

where RT : Has<Eff<RT>, FileIO>, Has<Eff<RT>, EncodingIO>

File IO

Methods

method Eff<RT, Unit> copy (string fromPath, string toPath, bool overwrite = false) Source #

Copy file

Parameters

type RT

Runtime

param fromPath

Source path

param toPath

Destination path

param overwrite

Overwrite if the file already exists at the destination

returns

Unit

method Eff<RT, Unit> appendAllLines (string path, IEnumerable<string> contents) Source #

Append lines to the end of the file provided

method Eff<RT, Seq<string>> readAllLines (string path) Source #

Read all of the lines from the path provided

method Eff<RT, Unit> writeAllLines (string path, Seq<string> lines) Source #

Write all of the lines to the path provided

method Eff<RT, string> readAllText (string path) Source #

Read all of the text from the path provided

method Eff<RT, byte[]> readAllBytes (string path) Source #

Read all of the data from the path provided

method Eff<RT, Unit> writeAllText (string path, string text) Source #

Write all of the text to the path provided

method Eff<RT, Unit> writeAllBytes (string path, byte[] data) Source #

Write all of the data to the path provided

method Eff<RT, Unit> delete (string path) Source #

Delete the file provided

method Eff<RT, bool> exists (string path) Source #

True if a file exists at the path

method Producer<TextReader, Eff<RT>, Unit> openText (string path) Source #

Open a text file

method Eff<RT, TextWriter> createText (string path) Source #

Create a new text file to stream to

method Eff<RT, TextWriter> appendText (string path) Source #

Return a stream to append text to

method Producer<Stream, Eff<RT>, Unit> openRead (string path) Source #

Open a file-stream

method Producer<Stream, Eff<RT>, Unit> open (string path, FileMode mode) Source #

Open a file-stream

method Producer<Stream, Eff<RT>, Unit> open (string path, FileMode mode, FileAccess access) Source #

Open a file-stream

method Producer<Stream, Eff<RT>, Unit> openWrite (string path) Source #

Open a file-stream

class Stream <M> Source #

where M : Monad<M>

Methods

method Pipe<Stream, SeqLoan<byte>, M, Unit> read (int chunkSize) Source #

Get a pipe of chunks from a Stream

class TextRead <M, RT> Source #

where RT : Has<M, TextReadIO>
where M : Monad<M>

Properties

property Pipe<TextReader, string, M, Unit> readLine Source #

Open a text file and streams the lines through the pipe

property Pipe<TextReader, char, M, Unit> readChar Source #

Open a text file and streams the chars through the pipe

property Pipe<TextReader, string, M, Unit> readToEnd Source #

Read the rest of the text in the stream

Methods

method Pipe<TextReader, SeqLoan<char>, M, Unit> readChars (int charCount) Source #

Repeatedly read a number of chars from the stream

method Pipe<TextReader, string, M, Unit> read (int charCount) Source #

Read a number of chars from the stream

method K<M, Unit> close (TextReader reader) Source #

Close the reader

class TextRead <RT> Source #

where RT : Has<Eff<RT>, TextReadIO>

Properties

property Pipe<TextReader, string, Eff<RT>, Unit> readLine Source #

Open a text file and streams the lines through the pipe

property Pipe<TextReader, char, Eff<RT>, Unit> readChar Source #

Open a text file and streams the chars through the pipe

property Pipe<TextReader, string, Eff<RT>, Unit> readToEnd Source #

Read the rest of the text in the stream

Methods

method Pipe<TextReader, SeqLoan<char>, Eff<RT>, Unit> readChars (int charCount) Source #

Repeatedly read a number of chars from the stream

method Pipe<TextReader, string, Eff<RT>, Unit> read (int charCount) Source #

Read a number of chars from the stream

method Eff<RT, Unit> close (TextReader reader) Source #

Close the reader