Table of Contents

Class FileUtils

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Contains static methods related to files.

public static class FileUtils
Inheritance
FileUtils

Methods

CreateFilePath(string)

Gets directory name of the specified file path and creates that directory if it is not exists.

CreateFilePathSafe(string)

Creates the directory for the specified file path if it does not already exist. This method is a safe version of CreateFilePath(string) that catches exceptions.

DeleteBinObjFiles(string)

Deletes all files in the 'bin' and 'obj' subfolders of the specified solution folder.

DeleteIfExists(string)

Deletes the specified file if it exists.

DeleteIfExistsSafe(string)

Deletes the specified file if it exists in a safe manner.

ExistingDirOrNull(string?)

Returns path if such directory exists; otherwise returns Null.

ExistsOnPathUsingWhere(string, string?)

Checks whether executable with the specified name exists on path. Uses 'where' or similar command.

FindFileRecursiveInAppFolder(string, string?)

Returns the full file name that match a search pattern in the application folder. Searches in all subdirectories.

FindFirstFile(string, string, SearchOption)

Returns the full file name that match a search pattern in a specified path, and optionally searches subdirectories.

GetFullPathUsingWhere(string, string?)

Finds path to executable by it's name using 'where' or similar command.

HasFiles(string, string)

Gets whether the specified folder has files with the given mask.

RealFileHasSameCase(string)

Gets whether the specified file name has the same char case as file on disk.

StringFromFile(string, Encoding?)

Reads string from the file using the specified encoding.

StringToFile(string, string, Encoding?)

Saves string to file. If file with such name already exists, it is deleted before saving the string.

StringToFileIfChanged(string, string, Encoding?)

Saves string to the specified file only if its contents is different from the saved string.