C# 클래스 DevUtils.Io.IoFileUtils

The IoFileUtils type provides an implementation of the IIoFileUtils interface that provides utility methods for common I/O file operations.

Base project reference: https://github.com/cjaehnen/OpenLib.Utils

상속: IIoFileUtils
파일 보기 프로젝트 열기: jornfilho/.net-Dev-Utils 1 사용 예제들

Private Properties

프로퍼티 타입 설명

공개 메소드들

메소드 설명
CopyFile ( string sourcePath, string targetPath ) : bool

Copies the specified source file to the target file path.

CreateFile ( string path, string contents ) : bool

Writes the specified contents to the specified file.

CreateFileTextWriter ( string path ) : TextWriter

Creates a file text writer used to create file output.

This implementation returns a StreamWriter.

CreateReadOnlyFile ( string path, string contents ) : bool

Creates a read only file for the specified file or sets the file to read only if it already exists.

DeleteFile ( string path ) : bool

Deletes the specified file from the file system.

DeleteFiles ( string path ) : int

Deletes all files in the specified directory.

FileExists ( string path ) : bool

Gets a value indicating if the specified file exists.

GetCountOfFilesInDirectory ( string path ) : int

Gets a count indicating the number of files in the specified directory.

GetCountOfFilesInDirectoryAndSubdirectories ( string path ) : int

Gets a count indicating the number of files in the specified directory and subdirectories.

IoFileUtils ( ) : System

Base class constructor

IsFileReadOnly ( string path ) : bool

Gets a value indicating if the specified file is read only.

ReadFileAsStream ( string path ) : FileStream

Reads and returns the contents of the specified file as a file stream.

ReadFileAsString ( string path ) : string

Reads and returns the contents of the specified file.

RemoveReadOnlyAttribute ( string path ) : bool

Remove read only attribute from file.

메소드 상세

CopyFile() 공개 메소드

Copies the specified source file to the target file path.
public CopyFile ( string sourcePath, string targetPath ) : bool
sourcePath string The path to the source file.
targetPath string The path to the target file.
리턴 bool

CreateFile() 공개 메소드

Writes the specified contents to the specified file.
public CreateFile ( string path, string contents ) : bool
path string The path to the file.
contents string The contents of the file.
리턴 bool

CreateFileTextWriter() 공개 메소드

Creates a file text writer used to create file output.
This implementation returns a StreamWriter.
public CreateFileTextWriter ( string path ) : TextWriter
path string The path to the file.
리턴 System.IO.TextWriter

CreateReadOnlyFile() 공개 메소드

Creates a read only file for the specified file or sets the file to read only if it already exists.
public CreateReadOnlyFile ( string path, string contents ) : bool
path string The path to the file to set as read only.
contents string The contents of the file.
리턴 bool

DeleteFile() 공개 메소드

Deletes the specified file from the file system.
public DeleteFile ( string path ) : bool
path string The path to the file.
리턴 bool

DeleteFiles() 공개 메소드

Deletes all files in the specified directory.
public DeleteFiles ( string path ) : int
path string The path to the directory.
리턴 int

FileExists() 공개 메소드

Gets a value indicating if the specified file exists.
public FileExists ( string path ) : bool
path string The path to the file.
리턴 bool

GetCountOfFilesInDirectory() 공개 메소드

Gets a count indicating the number of files in the specified directory.
public GetCountOfFilesInDirectory ( string path ) : int
path string The path to the directory.
리턴 int

GetCountOfFilesInDirectoryAndSubdirectories() 공개 메소드

Gets a count indicating the number of files in the specified directory and subdirectories.
public GetCountOfFilesInDirectoryAndSubdirectories ( string path ) : int
path string The path to the directory.
리턴 int

IoFileUtils() 공개 메소드

Base class constructor
public IoFileUtils ( ) : System
리턴 System

IsFileReadOnly() 공개 메소드

Gets a value indicating if the specified file is read only.
public IsFileReadOnly ( string path ) : bool
path string The path to the file to determine if it is read only.
리턴 bool

ReadFileAsStream() 공개 메소드

Reads and returns the contents of the specified file as a file stream.
public ReadFileAsStream ( string path ) : FileStream
path string The path to the file.
리턴 System.IO.FileStream

ReadFileAsString() 공개 메소드

Reads and returns the contents of the specified file.
public ReadFileAsString ( string path ) : string
path string The path to the file.
리턴 string

RemoveReadOnlyAttribute() 공개 메소드

Remove read only attribute from file.
public RemoveReadOnlyAttribute ( string path ) : bool
path string The path to the file to remove read only attribute.
리턴 bool