FileUtils

Overview

Static helper class that provides methods for manipulating files.

Location

Class Methods


AppendBinary

Appends Binary content to a specified file.

 

class method AppendBinary(FileName: String; Content: Binary)

 

static void AppendBinary(String FileName, Binary Content)

 

static func AppendBinary(_ FileName: String, _ Content: Binary)

 

static void AppendBinary(String FileName, Binary Content)

 

Shared Sub AppendBinary(FileName As String, Content As Binary)

Parameters:

  • FileName: The path to a file.
  • Content: Content to append.

AppendBytes

Appends array content to a specified file.

 

class method AppendBytes(FileName: String; Content: array of Byte)

 

static void AppendBytes(String FileName, Byte[] Content)

 

static func AppendBytes(_ FileName: String, _ Content: Byte...)

 

static void AppendBytes(String FileName, Byte[] Content)

 

Shared Sub AppendBytes(FileName As String, Content As Byte())

Parameters:

  • FileName: The path to a file.
  • Content: Content to append.

AppendText

Appends string content to a specified file.

 

class method AppendText(FileName: String; Content: String)

 

static void AppendText(String FileName, String Content)

 

static func AppendText(_ FileName: String, _ Content: String)

 

static void AppendText(String FileName, String Content)

 

Shared Sub AppendText(FileName As String, Content As String)

Parameters:

  • FileName: The path to a file.
  • Content: Content to append.

Copy

Copies an existing file to a new file.

 

class method Copy(SourceFileName: String; DestFileName: String)

 

static void Copy(String SourceFileName, String DestFileName)

 

static func Copy(_ SourceFileName: String, _ DestFileName: String)

 

static void Copy(String SourceFileName, String DestFileName)

 

Shared Sub Copy(SourceFileName As String, DestFileName As String)

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.

 

class method Exists(FileName: String): Boolean

 

static Boolean Exists(String FileName)

 

static func Exists(_ FileName: String) -> Boolean

 

static Boolean Exists(String FileName)

 

Shared Function Exists(FileName As String) As Boolean

Parameters:

  • FileName: Path to check.

Move

Copies an existing file to a new file.

 

class method Move(SourceFileName: String; DestFileName: String)

 

static void Move(String SourceFileName, String DestFileName)

 

static func Move(_ SourceFileName: String, _ DestFileName: String)

 

static void Move(String SourceFileName, String DestFileName)

 

Shared Sub Move(SourceFileName As String, DestFileName As String)

Parameters:

  • SourceFileName: Path to the existing file.
  • DestFileName: Path to a new file.

ReadBinary

Reads contents of the specified file.

 

class method ReadBinary(FileName: String): Binary

 

static Binary ReadBinary(String FileName)

 

static func ReadBinary(_ FileName: String) -> Binary

 

static Binary ReadBinary(String FileName)

 

Shared Function ReadBinary(FileName As String) As Binary

Parameters:

  • FileName: The path to a file.

ReadBytes

Reads contents of the specified file.

 

class method ReadBytes(FileName: String): array of Byte

 

static Byte[] ReadBytes(String FileName)

 

static func ReadBytes(_ FileName: String) -> Byte...

 

static Byte[] ReadBytes(String FileName)

 

Shared Function ReadBytes(FileName As String) As Byte()

Parameters:

  • FileName: The path to a file.

ReadText

 

class method ReadText(FileName: String; Encoding: Encoding): String

 

static String ReadText(String FileName, Encoding Encoding)

 

static func ReadText(_ FileName: String, _ Encoding: Encoding) -> String

 

static String ReadText(String FileName, Encoding Encoding)

 

Shared Function ReadText(FileName As String, Encoding As Encoding) As String

Parameters:

  • FileName:
  • Encoding:

WriteBinary

Writes Binary content to a specified file.

 

class method WriteBinary(FileName: String; Content: Binary)

 

static void WriteBinary(String FileName, Binary Content)

 

static func WriteBinary(_ FileName: String, _ Content: Binary)

 

static void WriteBinary(String FileName, Binary Content)

 

Shared Sub WriteBinary(FileName As String, Content As Binary)

Parameters:

  • FileName: The path to a file.
  • Content: Content to write.

WriteBytes

Writes array content to a specified file.

 

class method WriteBytes(FileName: String; Content: array of Byte)

 

static void WriteBytes(String FileName, Byte[] Content)

 

static func WriteBytes(_ FileName: String, _ Content: Byte...)

 

static void WriteBytes(String FileName, Byte[] Content)

 

Shared Sub WriteBytes(FileName As String, Content As Byte())

Parameters:

  • FileName: The path to a file.
  • Content: Content to write.

WriteText

Writes string content to a specified file.

 

class method WriteText(FileName: String; Content: String)

 

static void WriteText(String FileName, String Content)

 

static func WriteText(_ FileName: String, _ Content: String)

 

static void WriteText(String FileName, String Content)

 

Shared Sub WriteText(FileName As String, Content As String)

Parameters:

  • FileName: The path to a file.
  • Content: Content to write.