File Module
Contains helpers which allow to interact with the file system.
Functions and values
Function or value | Description |
Full Usage:
File.allExist files
Parameters:
seq<string>
-
The files names to check
Returns: bool
|
|
Full Usage:
File.append file lines
Parameters:
string
-
The file name to use
lines : seq<string>
-
The lines to append
|
|
Full Usage:
File.applyReplace replaceF fileName
Parameters:
string -> string
-
The callback to execute when replacing content
fileName : string
-
The file name to use
|
|
Full Usage:
File.checkExists fileName
Parameters:
string
|
|
Full Usage:
File.create fileName
Parameters:
string
-
The name of the file to create
|
|
Full Usage:
File.delete fileName
Parameters:
string
-
The name of the file to delete
|
|
Full Usage:
File.deleteAll files
Parameters:
seq<string>
-
The name of the files to delete
|
|
Full Usage:
File.exists fileName
Parameters:
string
-
The file name to check
Returns: bool
|
|
|
Detect the encoding, from https://stackoverflow.com/questions/3825390/effective-way-to-find-any-files-encoding Detect the encoding
|
|
|
|
|
Full Usage:
File.getVersion fileName
Parameters:
string
-
Name of file from which the version is retrieved. The path can be relative.
Returns: string
|
Get the version a file. This overload throws when the file has no version, consider using `tryGetVersion` instead. On non-windows platforms this API returns assembly metadata instead, FileVersionInfo.Unix.cs
|
Full Usage:
File.read file
Parameters:
string
Returns: seq<string>
|
|
Full Usage:
File.readAsBytes file
Parameters:
string
-
The file name to use
Returns: byte[]
|
|
Full Usage:
File.readAsString file
Parameters:
string
-
The file name to use
Returns: string
Modifiers: inline |
|
Full Usage:
File.readAsStringWithEncoding encoding file
Parameters:
Encoding
-
The encoding to use
file : string
-
The file name to use
Returns: string
Modifiers: inline |
|
Full Usage:
File.readLine file
Parameters:
string
-
The file name to use
Returns: string
|
|
Full Usage:
File.readLineWithEncoding encoding file
Parameters:
Encoding
-
The encoding to use
file : string
-
The file name to use
Returns: string
|
|
Full Usage:
File.readWithEncoding encoding file
Parameters:
Encoding
-
The encoding to use
file : string
-
The file name to use
Returns: seq<string>
|
|
Full Usage:
File.replaceContent fileName text
Parameters:
string
text : string
-
The string text to write
|
|
Full Usage:
File.tryGetVersion fileName
Parameters:
string
-
Name of file from which the version is retrieved. The path can be relative.
Returns: string option
|
Tries to get the version of a file. Throws `FileNotFoundException` if the file doesn't exist. Returns None if the file doesn't contain a `FileVersion` component. On non-windows platforms this API returns assembly metadata instead, see FileVersionInfo.Unix.cs
|
Full Usage:
File.write append fileName lines
Parameters:
bool
-
Flag to check if to append content or overwrite
fileName : string
lines : seq<string>
-
The lines to write
|
|
Full Usage:
File.writeBytes file bytes
Parameters:
string
-
The file name to use
bytes : byte[]
-
The bytes to write
|
|
Full Usage:
File.writeNew file lines
Parameters:
string
-
The file name to use
lines : seq<string>
-
The lines to write
|
|
Full Usage:
File.writeString append fileName text
Parameters:
bool
-
Flag to check if to append content or overwrite
fileName : string
text : string
-
The string text to write
|
|
Full Usage:
File.writeStringWithEncoding encoding append fileName text
Parameters:
Encoding
-
The encoding to use
append : bool
-
Flag to check if to append content or overwrite
fileName : string
text : string
-
The string text to write
|
|
Full Usage:
File.writeWithEncoding encoding append fileName lines
Parameters:
Encoding
-
The encoding to use
append : bool
-
Flag to check if to append content or overwrite
fileName : string
lines : seq<string>
-
The lines to write
|
|
Active patterns
Active pattern | Description |
Full Usage:
File.(|EndsWith|_|) extension file
Parameters:
string
-
The extension to look for
file : string
-
The file name to use
Returns: unit option
|
|