Logo GenPRES

File Module

Lists the files of a directory, reads the lines of a file, writes or appends text to a file and tests whether a file exists.

Functions and values

Function or value Description

File.appendTextToFile path text

Full Usage: File.appendTextToFile path text

Parameters:
    path : string
    text : string

Appends the given text to the given file

path : string
text : string

File.enumerate path

Full Usage: File.enumerate path

Parameters:
    path : string

Returns: FileInfo seq

Returns a sequence of all files in the given directory

path : string
Returns: FileInfo seq

File.exists path

Full Usage: File.exists path

Parameters:
    path : string

Returns: bool

Returns true if the given file exists

path : string
Returns: bool

File.readAllLines path

Full Usage: File.readAllLines path

Parameters:
    path : string

Returns: string[]

Reads all lines from the given file

path : string
Returns: string[]

File.readAllLinesAsync path

Full Usage: File.readAllLinesAsync path

Parameters:
    path : string

Returns: Async<string list>

Reads all lines from the given file asynchronously

path : string
Returns: Async<string list>

File.writeTextToFile path text

Full Usage: File.writeTextToFile path text

Parameters:
    path : string
    text : string

Writes the given text to the given file

path : string
text : string

Type something to start searching.