FileUtils
Overview
Static helper class that provides methods for manipulating files.
Location
- Reference: Sugar
- Namespace: Sugar.IO
Class Methods
AppendBinary
Appends Binary content to a specified file.
Parameters:
- FileName: The path to a file.
- Content: Content to append.
AppendBytes
Appends array content to a specified file.
Parameters:
- FileName: The path to a file.
- Content: Content to append.
AppendText
Appends string content to a specified file.
Parameters:
- FileName: The path to a file.
- Content: Content to append.
Copy
Copies an existing file to a new file.
Parameters:
- SourceFileName: Path to the existing file.
- DestFileName: Path to a new file.
Create
Creates new file with specified path.
class method Create(FileName: String)
static void Create(String FileName)
static func Create(_ FileName: String)
static void Create(String FileName)
Shared Sub Create(FileName As String)
Parameters:
- FileName: Path to a new file.
Delete
Deletes existing file with specified path.
class method Delete(FileName: String)
static void Delete(String FileName)
static func Delete(_ FileName: String)
static void Delete(String FileName)
Shared Sub Delete(FileName As String)
Parameters:
- FileName: Path to the existing file.
Exists
Determines whether the specified file exists.
Parameters:
- FileName: Path to check.
Move
Copies an existing file to a new file.
Parameters:
- SourceFileName: Path to the existing file.
- DestFileName: Path to a new file.
ReadBinary
Reads contents of the specified file.
Parameters:
- FileName: The path to a file.
ReadBytes
Reads contents of the specified file.
Parameters:
- FileName: The path to a file.
ReadText
Parameters:
- FileName:
- Encoding:
WriteBinary
Writes Binary content to a specified file.
Parameters:
- FileName: The path to a file.
- Content: Content to write.
WriteBytes
Writes array content to a specified file.
Parameters:
- FileName: The path to a file.
- Content: Content to write.
WriteText
Writes string content to a specified file.
Parameters:
- FileName: The path to a file.
- Content: Content to write.