C# Class AcTools.Utils.FileUtils

Mostra file Open project: gro-ove/actools Class Usage Examples

Public Methods

Method Description
ChangeDirectory ( string from, string to ) : void

Move directory or file (without changing the name!)

CopyRecursive ( string source, string destination ) : void
CopyRecursiveHardlink ( string source, string destination ) : void
DeleteSilent ( ) : bool
EnsureDirectoryExists ( string directory ) : void
EnsureFileDirectoryExists ( string filename ) : void
EnsureFileNameIsValid ( string fileName ) : string
EnsureUnique ( string filename ) : string
Exists ( string location ) : bool

If directory or file exists.

FastChecksum ( string filename ) : string
FindRenamedFile ( string baseDirectory, string missingFilename ) : IEnumerable
GetAcLauncherFilename ( string acRoot ) : string
GetAcLogoFilename ( string acRoot ) : string
GetAssistsIniFilename ( ) : string
GetCarDirectory ( string acRoot, string carName ) : string
GetCarSetupsDirectory ( ) : string
GetCarSetupsDirectory ( string carName ) : string
GetCarSkinDirectory ( string acRoot, string carName, string skinName ) : string
GetCarSkinsDirectory ( string carDir ) : string
GetCarSkinsDirectory ( string acRoot, string carName ) : string
GetCarsDirectory ( string acRoot ) : string
GetCfgShowroomFilename ( ) : string
GetCfgVideoFilename ( ) : string
GetDocumentsCfgDirectory ( ) : string
GetDocumentsDirectory ( ) : string
GetDocumentsOutDirectory ( ) : string
GetDocumentsScreensDirectory ( ) : string
GetFilesAndDirectories ( string directory ) : IEnumerable
GetFontsDirectory ( string acRoot ) : string
GetKunosCareerDirectory ( string acRoot ) : string
GetKunosCareerProgressFilename ( ) : string
GetLogFilename ( ) : string
GetLogFilename ( string logFileName ) : string
GetMainCarFilename ( string carDir ) : string
GetMainCarFilename ( string carDir, DataWrapper data ) : string
GetMainCarFilename ( string acRoot, string carName ) : string
GetOriginalFilename ( string filename ) : string

Helps to find original casing.

GetPpFiltersDirectory ( string acRoot ) : string
GetPythonAppsDirectory ( string acRoot ) : string
GetRaceIniFilename ( ) : string
GetRelativePath ( [ filename, [ directory ) : string

GetReplaysDirectory ( ) : string
GetResultJsonFilename ( ) : string
GetSfxDirectory ( string acRoot ) : string
GetSfxGuidsFilename ( string acRoot ) : string
GetShowroomDirectory ( string acRoot, string showroomName ) : string
GetShowroomsDirectory ( string acRoot ) : string
GetSystemCfgDirectory ( string acRoot ) : string
GetTempFileName ( string dir ) : string
GetTempFileName ( string dir, string extension ) : string
GetTempFileNameFixed ( string dir, string fixedName ) : string
GetTracksDirectory ( string acRoot ) : string
GetWeatherDirectory ( string acRoot ) : string
Hardlink ( [ source, [ destination, bool overwrite = false ) : void
IsAffected ( [ parent, [ child ) : bool

Is A in any way a parent of B?

IsDirectory ( [ filename ) : bool

Check if filename is a directory.

Move ( string from, string to ) : void

Move directory or file

ReadAllText ( string filename ) : string
ReadableSize ( long size ) : string
Recycle ( ) : bool
RecycleVisible ( ) : bool
RestoreLater ( string filename ) : IDisposable

How should I call it?

Split ( string s ) : string[]
TemporaryRemove ( string filename ) : IDisposable
Undo ( ) : bool
Unzip ( string pathToZip, string destination ) : void
WriteAllBytesAsync ( [ filename, [ bytes, CancellationToken cancellation = default(CancellationToken) ) : Task

Private Methods

Method Description
CouldBeRenamedFile ( string baseDirectory, string original, string candidate ) : bool
DeleteFile ( string path, FileOperationFlags flags ) : bool
GetDocumentsFiltersDirectory ( ) : string
GetFilesRecursive ( string path, string searchPattern = null ) : IEnumerable
GetFilesSafe ( [ path, string searchPattern = null, SearchOption searchOption = SearchOption.TopDirectoryOnly ) : string[]
ReadAllBytesAsync ( string filename, CancellationToken cancellation = default(CancellationToken) ) : Task
SHFileOperation ( SHFILEOPSTRUCT &FileOp ) : int

Method Details

ChangeDirectory() public static method

Move directory or file (without changing the name!)
public static ChangeDirectory ( string from, string to ) : void
from string
to string
return void

CopyRecursive() public static method

public static CopyRecursive ( string source, string destination ) : void
source string
destination string
return void

CopyRecursiveHardlink() public static method

public static CopyRecursiveHardlink ( string source, string destination ) : void
source string
destination string
return void

DeleteSilent() public static method

public static DeleteSilent ( ) : bool
return bool

EnsureDirectoryExists() public static method

public static EnsureDirectoryExists ( string directory ) : void
directory string
return void

EnsureFileDirectoryExists() public static method

public static EnsureFileDirectoryExists ( string filename ) : void
filename string
return void

EnsureFileNameIsValid() public static method

public static EnsureFileNameIsValid ( string fileName ) : string
fileName string
return string

EnsureUnique() public static method

public static EnsureUnique ( string filename ) : string
filename string
return string

Exists() public static method

If directory or file exists.
public static Exists ( string location ) : bool
location string
return bool

FastChecksum() public static method

public static FastChecksum ( string filename ) : string
filename string
return string

FindRenamedFile() public static method

public static FindRenamedFile ( string baseDirectory, string missingFilename ) : IEnumerable
baseDirectory string
missingFilename string
return IEnumerable

GetAcLauncherFilename() public static method

public static GetAcLauncherFilename ( string acRoot ) : string
acRoot string
return string

GetAcLogoFilename() public static method

public static GetAcLogoFilename ( string acRoot ) : string
acRoot string
return string

GetAssistsIniFilename() public static method

public static GetAssistsIniFilename ( ) : string
return string

GetCarDirectory() public static method

public static GetCarDirectory ( string acRoot, string carName ) : string
acRoot string
carName string
return string

GetCarSetupsDirectory() public static method

public static GetCarSetupsDirectory ( ) : string
return string

GetCarSetupsDirectory() public static method

public static GetCarSetupsDirectory ( string carName ) : string
carName string
return string

GetCarSkinDirectory() public static method

public static GetCarSkinDirectory ( string acRoot, string carName, string skinName ) : string
acRoot string
carName string
skinName string
return string

GetCarSkinsDirectory() public static method

public static GetCarSkinsDirectory ( string carDir ) : string
carDir string
return string

GetCarSkinsDirectory() public static method

public static GetCarSkinsDirectory ( string acRoot, string carName ) : string
acRoot string
carName string
return string

GetCarsDirectory() public static method

public static GetCarsDirectory ( string acRoot ) : string
acRoot string
return string

GetCfgShowroomFilename() public static method

public static GetCfgShowroomFilename ( ) : string
return string

GetCfgVideoFilename() public static method

public static GetCfgVideoFilename ( ) : string
return string

GetDocumentsCfgDirectory() public static method

public static GetDocumentsCfgDirectory ( ) : string
return string

GetDocumentsDirectory() public static method

public static GetDocumentsDirectory ( ) : string
return string

GetDocumentsOutDirectory() public static method

public static GetDocumentsOutDirectory ( ) : string
return string

GetDocumentsScreensDirectory() public static method

public static GetDocumentsScreensDirectory ( ) : string
return string

GetFilesAndDirectories() public static method

public static GetFilesAndDirectories ( string directory ) : IEnumerable
directory string
return IEnumerable

GetFontsDirectory() public static method

public static GetFontsDirectory ( string acRoot ) : string
acRoot string
return string

GetKunosCareerDirectory() public static method

public static GetKunosCareerDirectory ( string acRoot ) : string
acRoot string
return string

GetKunosCareerProgressFilename() public static method

public static GetKunosCareerProgressFilename ( ) : string
return string

GetLogFilename() public static method

public static GetLogFilename ( ) : string
return string

GetLogFilename() public static method

public static GetLogFilename ( string logFileName ) : string
logFileName string
return string

GetMainCarFilename() public static method

public static GetMainCarFilename ( string carDir ) : string
carDir string
return string

GetMainCarFilename() public static method

public static GetMainCarFilename ( string carDir, DataWrapper data ) : string
carDir string
data AcTools.DataFile.DataWrapper
return string

GetMainCarFilename() public static method

public static GetMainCarFilename ( string acRoot, string carName ) : string
acRoot string
carName string
return string

GetOriginalFilename() public static method

Helps to find original casing.
public static GetOriginalFilename ( string filename ) : string
filename string
return string

GetPpFiltersDirectory() public static method

public static GetPpFiltersDirectory ( string acRoot ) : string
acRoot string
return string

GetPythonAppsDirectory() public static method

public static GetPythonAppsDirectory ( string acRoot ) : string
acRoot string
return string

GetRaceIniFilename() public static method

public static GetRaceIniFilename ( ) : string
return string

GetRelativePath() public static method

public static GetRelativePath ( [ filename, [ directory ) : string
filename [ Ex.: C:\Windows\System32\explorer.exe
directory [ Ex.: C:\Windows
return string

GetReplaysDirectory() public static method

public static GetReplaysDirectory ( ) : string
return string

GetResultJsonFilename() public static method

public static GetResultJsonFilename ( ) : string
return string

GetSfxDirectory() public static method

public static GetSfxDirectory ( string acRoot ) : string
acRoot string
return string

GetSfxGuidsFilename() public static method

public static GetSfxGuidsFilename ( string acRoot ) : string
acRoot string
return string

GetShowroomDirectory() public static method

public static GetShowroomDirectory ( string acRoot, string showroomName ) : string
acRoot string
showroomName string
return string

GetShowroomsDirectory() public static method

public static GetShowroomsDirectory ( string acRoot ) : string
acRoot string
return string

GetSystemCfgDirectory() public static method

public static GetSystemCfgDirectory ( string acRoot ) : string
acRoot string
return string

GetTempFileName() public static method

public static GetTempFileName ( string dir ) : string
dir string
return string

GetTempFileName() public static method

public static GetTempFileName ( string dir, string extension ) : string
dir string
extension string
return string

GetTempFileNameFixed() public static method

public static GetTempFileNameFixed ( string dir, string fixedName ) : string
dir string
fixedName string
return string

GetTracksDirectory() public static method

public static GetTracksDirectory ( string acRoot ) : string
acRoot string
return string

GetWeatherDirectory() public static method

public static GetWeatherDirectory ( string acRoot ) : string
acRoot string
return string

Hardlink() public static method

public static Hardlink ( [ source, [ destination, bool overwrite = false ) : void
source [
destination [
overwrite bool
return void

IsAffected() public static method

Is A in any way a parent of B?
public static IsAffected ( [ parent, [ child ) : bool
parent [ For example, “C:\Windows”
child [ For example, “c:/windows/system32”
return bool

IsDirectory() public static method

Check if filename is a directory.
public static IsDirectory ( [ filename ) : bool
filename [
return bool

Move() public static method

Move directory or file
public static Move ( string from, string to ) : void
from string
to string
return void

ReadAllText() public static method

public static ReadAllText ( string filename ) : string
filename string
return string

ReadableSize() public static method

public static ReadableSize ( long size ) : string
size long
return string

Recycle() public static method

public static Recycle ( ) : bool
return bool

RecycleVisible() public static method

public static RecycleVisible ( ) : bool
return bool

RestoreLater() public static method

How should I call it?
public static RestoreLater ( string filename ) : IDisposable
filename string
return IDisposable

Split() public static method

public static Split ( string s ) : string[]
s string
return string[]

TemporaryRemove() public static method

public static TemporaryRemove ( string filename ) : IDisposable
filename string
return IDisposable

Undo() public static method

public static Undo ( ) : bool
return bool

Unzip() public static method

public static Unzip ( string pathToZip, string destination ) : void
pathToZip string
destination string
return void

WriteAllBytesAsync() public static method

public static WriteAllBytesAsync ( [ filename, [ bytes, CancellationToken cancellation = default(CancellationToken) ) : Task
filename [
bytes [
cancellation CancellationToken
return Task