PgVFS.NET
A C# System.IO compatible File System on Postgres
 All Classes Namespaces Functions Enumerations Enumerator Properties Pages
Vfs.IVfsFile Interface Reference

A System.IO.File singleton equivalent More...

Public Member Functions

void AppendAllLines (string path, IEnumerable< string > contents)
 Appends all lines to a file More...
 
void AppendAllLines (string path, IEnumerable< string > contents, Encoding encoding)
 Appends all lines to a file with encoding More...
 
void AppendAllText (string path, string contents)
 Appends text to a file More...
 
void AppendAllText (string path, string contents, Encoding encoding)
 Appends text to a file with encoding More...
 
StreamWriter AppendText (string path)
 Creates an stream that appends text More...
 
void Copy (string sourceFileName, string destFileName, bool overwrite=false)
 Copies an existing file to a new file. Overwriting a file of the same name is allowed. More...
 
Stream Create (string path, int bufferSize=4096)
 Creates or overwrites the specified file with the specified buffer size More...
 
StreamWriter CreateText (string path)
 Creates a file in text mode and returns a StreamWriter More...
 
void Delete (string path)
 Deletes a file More...
 
bool Exists (string path)
 File exists? More...
 
DateTime GetCreationTime (string path)
 Gets creation time in local zone More...
 
DateTime GetCreationTimeUtc (string path)
 Gets creation time in UTC More...
 
DateTime GetLastWriteTime (string path)
 Gets last write time in local zone More...
 
DateTime GetLastWriteTimeUtc (string path)
 Gets last write time in UTC More...
 
long GetLength (string file)
 Gets file length More...
 
void Move (string sourceFileName, string destFileName)
 Moves or renames a file More...
 
Stream Open (string file_path, FileMode mode, FileAccess access=FileAccess.ReadWrite, FileShare share=FileShare.ReadWrite)
 Opens a System.IO.Stream on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option. More...
 
Stream OpenRead (string path)
 Creates or opens a file for writing UTF-8 encoded text More...
 
StreamReader OpenText (string path)
 Opens an existing UTF-8 encoded text file for reading. More...
 
Stream OpenWrite (string path)
 Opens an existing file for writing. More...
 
byte[] ReadAllBytes (string path)
 Opens a binary file, reads the contents of the file into a byte array, and then closes the file More...
 
string[] ReadAllLines (string path, Encoding encoding=null)
 Opens a file, reads all lines of the file with the specified encoding, and then closes the file. More...
 
string ReadAllText (string path, Encoding encoding=null)
 Opens a file, reads all lines of the file with the specified encoding, and then closes the file. More...
 
IEnumerable< string > ReadLines (string path, Encoding encoding=null)
 Read the lines of a file that has a specified encoding. More...
 
void SetLastWriteTime (string path, DateTime lastWriteTime)
 Sets the date and time that the specified file was last written to. More...
 
void SetLastWriteTimeUtc (string path, DateTime lastWriteTimeUtc)
 Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to. More...
 
void WriteAllBytes (string path, byte[] bytes)
 Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten. More...
 
void WriteAllLines (string path, IEnumerable< string > contents)
 Creates a new file, writes a collection of strings to the file, and then closes the file. More...
 
void WriteAllLines (string path, string[] contents)
 Creates a new file, write the specified string array to the file, and then closes the file. More...
 
void WriteAllLines (string path, IEnumerable< string > contents, Encoding encoding)
 Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file. More...
 
void WriteAllLines (string path, string[] contents, Encoding encoding)
 Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file. More...
 
void WriteAllText (string path, string contents)
 Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten. More...
 
void WriteAllText (string path, string contents, Encoding encoding)
 Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten. More...
 

Detailed Description

A System.IO.File singleton equivalent

Member Function Documentation

void Vfs.IVfsFile.AppendAllLines ( string  path,
IEnumerable< string >  contents 
)

Appends all lines to a file

Parameters
path
contents
void Vfs.IVfsFile.AppendAllLines ( string  path,
IEnumerable< string >  contents,
Encoding  encoding 
)

Appends all lines to a file with encoding

Parameters
path
contents
encoding
void Vfs.IVfsFile.AppendAllText ( string  path,
string  contents 
)

Appends text to a file

Parameters
path
contents
void Vfs.IVfsFile.AppendAllText ( string  path,
string  contents,
Encoding  encoding 
)

Appends text to a file with encoding

Parameters
path
contents
encoding
StreamWriter Vfs.IVfsFile.AppendText ( string  path)

Creates an stream that appends text

Parameters
path
Returns
void Vfs.IVfsFile.Copy ( string  sourceFileName,
string  destFileName,
bool  overwrite = false 
)

Copies an existing file to a new file. Overwriting a file of the same name is allowed.

Parameters
sourceFileName
destFileName
overwrite
Stream Vfs.IVfsFile.Create ( string  path,
int  bufferSize = 4096 
)

Creates or overwrites the specified file with the specified buffer size

Parameters
path
bufferSize
Returns
StreamWriter Vfs.IVfsFile.CreateText ( string  path)

Creates a file in text mode and returns a StreamWriter

Parameters
path
Returns
void Vfs.IVfsFile.Delete ( string  path)

Deletes a file

Parameters
path
bool Vfs.IVfsFile.Exists ( string  path)

File exists?

Parameters
path
Returns
DateTime Vfs.IVfsFile.GetCreationTime ( string  path)

Gets creation time in local zone

Parameters
path
Returns
DateTime Vfs.IVfsFile.GetCreationTimeUtc ( string  path)

Gets creation time in UTC

Parameters
path
Returns
DateTime Vfs.IVfsFile.GetLastWriteTime ( string  path)

Gets last write time in local zone

Parameters
path
Returns
DateTime Vfs.IVfsFile.GetLastWriteTimeUtc ( string  path)

Gets last write time in UTC

Parameters
path
Returns
long Vfs.IVfsFile.GetLength ( string  file)

Gets file length

Parameters
file
Returns
void Vfs.IVfsFile.Move ( string  sourceFileName,
string  destFileName 
)

Moves or renames a file

Parameters
sourceFileName
destFileName
Stream Vfs.IVfsFile.Open ( string  file_path,
FileMode  mode,
FileAccess  access = FileAccess.ReadWrite,
FileShare  share = FileShare.ReadWrite 
)

Opens a System.IO.Stream on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option.

Parameters
file_path
mode
access
share
Returns
Stream Vfs.IVfsFile.OpenRead ( string  path)

Creates or opens a file for writing UTF-8 encoded text

Parameters
path
Returns
StreamReader Vfs.IVfsFile.OpenText ( string  path)

Opens an existing UTF-8 encoded text file for reading.

Parameters
path
Returns
Stream Vfs.IVfsFile.OpenWrite ( string  path)

Opens an existing file for writing.

Parameters
path
Returns
byte [] Vfs.IVfsFile.ReadAllBytes ( string  path)

Opens a binary file, reads the contents of the file into a byte array, and then closes the file

Parameters
path
Returns
string [] Vfs.IVfsFile.ReadAllLines ( string  path,
Encoding  encoding = null 
)

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.

Parameters
path
encoding
Returns
string Vfs.IVfsFile.ReadAllText ( string  path,
Encoding  encoding = null 
)

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.

Parameters
path
encoding
Returns
IEnumerable<string> Vfs.IVfsFile.ReadLines ( string  path,
Encoding  encoding = null 
)

Read the lines of a file that has a specified encoding.

Parameters
path
encoding
Returns
void Vfs.IVfsFile.SetLastWriteTime ( string  path,
DateTime  lastWriteTime 
)

Sets the date and time that the specified file was last written to.

Parameters
path
lastWriteTime
void Vfs.IVfsFile.SetLastWriteTimeUtc ( string  path,
DateTime  lastWriteTimeUtc 
)

Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.

Parameters
path
lastWriteTimeUtc
void Vfs.IVfsFile.WriteAllBytes ( string  path,
byte[]  bytes 
)

Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.

Parameters
path
bytes
void Vfs.IVfsFile.WriteAllLines ( string  path,
IEnumerable< string >  contents 
)

Creates a new file, writes a collection of strings to the file, and then closes the file.

Parameters
path
contents
void Vfs.IVfsFile.WriteAllLines ( string  path,
string[]  contents 
)

Creates a new file, write the specified string array to the file, and then closes the file.

Parameters
path
contents
void Vfs.IVfsFile.WriteAllLines ( string  path,
IEnumerable< string >  contents,
Encoding  encoding 
)

Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.

Parameters
path
contents
encoding
void Vfs.IVfsFile.WriteAllLines ( string  path,
string[]  contents,
Encoding  encoding 
)

Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.

Parameters
path
contents
encoding
void Vfs.IVfsFile.WriteAllText ( string  path,
string  contents 
)

Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.

Parameters
path
contents
void Vfs.IVfsFile.WriteAllText ( string  path,
string  contents,
Encoding  encoding 
)

Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.

Parameters
path
contents
encoding

The documentation for this interface was generated from the following file: