File Static Class

Definition

Line 11 of System.Base/File.cm

Member Functions

public static StreamWriter AppendText(const String<char>& filePath) Opens a UTF-8 encoded text file for appending.
public static void Copy(const String<char>& sourceFilePath, const String<char>& targetFilePath)
public static BinaryWriter CreateBinary(const String<char>& filePath) Creates a binary file.
public static StreamWriter CreateText(const String<char>& filePath) Creates a UTF-8 encoded text file.
public static nothrow bool Exists(const String<char>& filePath) Returns true, if the given file exists and false otherwise.
public static nothrow bool LastWriteTimeLess(const String<char>& filePath1, const String<char>& filePath2) Returns true if the last write time of the first file is less than the last write time of the second file, and false otherwise.
public static void Move(const String<char>& sourceFilePath, const String<char>& targetFilePath)
public static BinaryReader OpenBinary(const String<char>& filePath) Opens a binary file for reading.
public static StreamReader OpenRead(const String<char>& filePath) Opens a UTF-8 encoded text file for reading.
public static List<String<char>> ReadAllLines(const String<char>& filePath) Reads all lines of the given UTF-8 encoded text file into a List of string s and returns the list.
public static String<char> ReadAllText(const String<char>& filePath) Reads the contents of a UTF-8 encoded text file into a string and returns it.
public static void Remove(const String<char>& filePath)
public static long Size(const String<char>& filePath) Returns the size of the given file.

Member Function Details

AppendText Static Member Function

public static StreamWriter AppendText(const String<char>& filePath)

Opens a UTF-8 encoded text file for appending.

Definition
Line 46 of System.Base/File.cm


Copy Static Member Function

public static void Copy(const String<char>& sourceFilePath, const String<char>& targetFilePath)

Definition
Line 109 of System.Base/File.cm


CreateBinary Static Member Function

public static BinaryWriter CreateBinary(const String<char>& filePath)

Creates a binary file.

Integers are written in big-endian byte order. Strings are written UTF-8 encoded and zero byte terminated.

Definition
Line 41 of System.Base/File.cm


CreateText Static Member Function

public static StreamWriter CreateText(const String<char>& filePath)

Creates a UTF-8 encoded text file.

Definition
Line 36 of System.Base/File.cm


Exists Static Member Function

public static nothrow bool Exists(const String<char>& filePath)

Returns true, if the given file exists and false otherwise.

Definition
Line 13 of System.Base/File.cm


LastWriteTimeLess Static Member Function

public static nothrow bool LastWriteTimeLess(const String<char>& filePath1, const String<char>& filePath2)

Returns true if the last write time of the first file is less than the last write time of the second file, and false otherwise.

Definition
Line 32 of System.Base/File.cm


Move Static Member Function

public static void Move(const String<char>& sourceFilePath, const String<char>& targetFilePath)

Definition
Line 119 of System.Base/File.cm


OpenBinary Static Member Function

public static BinaryReader OpenBinary(const String<char>& filePath)

Opens a binary file for reading.

Integers are expected to be in big-endian byte order. Strings are expected to be UTF-8 encoded and zero byte terminated.

Definition
Line 56 of System.Base/File.cm


OpenRead Static Member Function

public static StreamReader OpenRead(const String<char>& filePath)

Opens a UTF-8 encoded text file for reading.

Definition
Line 51 of System.Base/File.cm


ReadAllLines Static Member Function

public static List<String<char>> ReadAllLines(const String<char>& filePath)

Reads all lines of the given UTF-8 encoded text file into a List of string s and returns the list.

Each line in the file is represented as a UTF-8 encoded string without a newline terminator.

Definition
Line 74 of System.Base/File.cm


ReadAllText Static Member Function

public static String<char> ReadAllText(const String<char>& filePath)

Reads the contents of a UTF-8 encoded text file into a string and returns it.

Each newline in the file is represented as a single linefeed character in the returned string.

Definition
Line 61 of System.Base/File.cm


Remove Static Member Function

public static void Remove(const String<char>& filePath)

Definition
Line 99 of System.Base/File.cm


Size Static Member Function

public static long Size(const String<char>& filePath)

Returns the size of the given file.

If the file does not exist, or in case of other error a FileSystemException exception is thrown.

Definition
Line 17 of System.Base/File.cm