KSP API
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions | Properties | List of all members
KSP.IO.FileInfo Class Reference

A surrogate for System.IO.FileInfo. More...

Public Member Functions

TextWriter AppendText ()
 Creates a System.IO.StreamWriter that appends text to the file represented by this instance of the System.IO.FileInfo. More...
 
FileInfo CopyTo (string destFileName)
 Copies an existing file to a new file, disallowing the overwriting of an existing file. More...
 
FileInfo CopyTo (string destFileName, bool overwrite)
 Copies an existing file to a new file, allowing the overwriting of an existing file. More...
 
FileStream Create ()
 Creates a file. More...
 
TextWriter CreateText ()
 Creates a KSP.IO.TextWriter that writes a new text file. More...
 
void Decrypt ()
 Decrypts a file that was encrypted by the current account using the System.IO.FileInfo.Encrypt() method. More...
 
void Delete ()
 Permanently deletes a file. More...
 
void Encrypt ()
 Encrypts a file so that only the account used to encrypt the file can decrypt it. More...
 
void MoveTo (string destFileName)
 Moves a specified file to a new location, providing the option to specify a new file name. More...
 
FileStream Open (FileMode mode)
 Opens a file in the specified mode. More...
 
FileStream Open (FileMode mode, FileAccess access)
 Opens a file in the specified mode with read, write, or read/write access. More...
 
FileStream Open (FileMode mode, FileAccess access, FileShare share)
 Opens a file in the specified mode with read, write, or read/write access and the specified sharing option. More...
 
FileStream OpenRead ()
 Creates a read-only System.IO.FileStream. More...
 
TextReader OpenText ()
 Creates a System.IO.StreamReader with UTF8 encoding that reads from an existing text file. More...
 
FileStream OpenWrite ()
 Creates a write-only System.IO.FileStream. More...
 
FileInfo Replace (string destinationFileName, string destinationBackupFileName)
 Replaces the contents of a specified file with the file described by the current System.IO.FileInfo object, deleting the original file, and creating a backup of the replaced file. More...
 
FileInfo Replace (string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors)
 Replaces the contents of a specified file with the file described by the current System.IO.FileInfo object, deleting the original file, and creating a backup of the replaced file. Also specifies whether to ignore merge errors. More...
 
string ToString ()
 Returns the path as a string. More...
 

Static Public Member Functions

static FileInfo CreateForType< T > (string filename, Vessel flight=null)
 Create a text reader stream. More...
 

Properties

string DirectoryName [get]
 Gets a string representing the directory's full path. More...
 
bool Exists [get]
 Gets a value indicating whether a file exists. More...
 
bool IsReadOnly [get, set]
 Gets or sets a value that determines if the current file is read only. More...
 
long Length [get]
 Gets the size, in bytes, of the current file. More...
 
string Name [get]
 Gets the name of the file. More...
 

Detailed Description

A surrogate for System.IO.FileInfo.

Member Function Documentation

TextWriter KSP.IO.FileInfo.AppendText ( )

Creates a System.IO.StreamWriter that appends text to the file represented by this instance of the System.IO.FileInfo.

Returns
FileInfo KSP.IO.FileInfo.CopyTo ( string  destFileName)

Copies an existing file to a new file, disallowing the overwriting of an existing file.

Parameters
destFileName
Returns
FileInfo KSP.IO.FileInfo.CopyTo ( string  destFileName,
bool  overwrite 
)

Copies an existing file to a new file, allowing the overwriting of an existing file.

Parameters
destFileName
overwrite
Returns
FileStream KSP.IO.FileInfo.Create ( )

Creates a file.

Returns
static FileInfo KSP.IO.FileInfo.CreateForType< T > ( string  filename,
Vessel  flight = null 
)
static

Create a text reader stream.

Template Parameters
T
Parameters
filename
flight
Returns
TextWriter KSP.IO.FileInfo.CreateText ( )

Creates a KSP.IO.TextWriter that writes a new text file.

Returns
void KSP.IO.FileInfo.Decrypt ( )

Decrypts a file that was encrypted by the current account using the System.IO.FileInfo.Encrypt() method.

void KSP.IO.FileInfo.Delete ( )

Permanently deletes a file.

void KSP.IO.FileInfo.Encrypt ( )

Encrypts a file so that only the account used to encrypt the file can decrypt it.

void KSP.IO.FileInfo.MoveTo ( string  destFileName)

Moves a specified file to a new location, providing the option to specify a new file name.

Parameters
destFileName
FileStream KSP.IO.FileInfo.Open ( FileMode  mode)

Opens a file in the specified mode.

Parameters
mode
Returns
FileStream KSP.IO.FileInfo.Open ( FileMode  mode,
FileAccess  access 
)

Opens a file in the specified mode with read, write, or read/write access.

Parameters
mode
access
Returns
FileStream KSP.IO.FileInfo.Open ( FileMode  mode,
FileAccess  access,
FileShare  share 
)

Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.

Parameters
mode
access
share
Returns
FileStream KSP.IO.FileInfo.OpenRead ( )

Creates a read-only System.IO.FileStream.

Returns
TextReader KSP.IO.FileInfo.OpenText ( )

Creates a System.IO.StreamReader with UTF8 encoding that reads from an existing text file.

Returns
FileStream KSP.IO.FileInfo.OpenWrite ( )

Creates a write-only System.IO.FileStream.

Returns
FileInfo KSP.IO.FileInfo.Replace ( string  destinationFileName,
string  destinationBackupFileName 
)

Replaces the contents of a specified file with the file described by the current System.IO.FileInfo object, deleting the original file, and creating a backup of the replaced file.

Parameters
destinationFileName
destinationBackupFileName
Returns
FileInfo KSP.IO.FileInfo.Replace ( string  destinationFileName,
string  destinationBackupFileName,
bool  ignoreMetadataErrors 
)

Replaces the contents of a specified file with the file described by the current System.IO.FileInfo object, deleting the original file, and creating a backup of the replaced file. Also specifies whether to ignore merge errors.

Parameters
destinationFileName
destinationBackupFileName
ignoreMetadataErrors
Returns
string KSP.IO.FileInfo.ToString ( )

Returns the path as a string.

Returns

Property Documentation

string KSP.IO.FileInfo.DirectoryName
get

Gets a string representing the directory's full path.

bool KSP.IO.FileInfo.Exists
get

Gets a value indicating whether a file exists.

bool KSP.IO.FileInfo.IsReadOnly
getset

Gets or sets a value that determines if the current file is read only.

long KSP.IO.FileInfo.Length
get

Gets the size, in bytes, of the current file.

string KSP.IO.FileInfo.Name
get

Gets the name of the file.


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