Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Properties | List of all members
KSP.IO.FileInfo Class Reference

File IO methods 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, bool overwrite)
 Copies an existing file to a new file, allowing the overwriting of an existing file. More...
 
FileInfo CopyTo (string destFileName)
 Copies an existing file to a new file, disallowing 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, FileAccess access)
 Opens a file in the specified mode with read, write, or read/write access. More...
 
FileStream Open (FileMode mode)
 Opens a file in the specified mode. 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, 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...
 
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...
 
override 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

File IO methods

Member Function Documentation

TextWriter KSP.IO.FileInfo.AppendText ( )
inline

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

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

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

Parameters
overwritetrue to allow an existing file to be overwritten; otherwise, false.
destFileNameThe name of the new file to copy to.
FileInfo KSP.IO.FileInfo.CopyTo ( string  destFileName)
inline

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

Parameters
destFileNameThe name of the new file to copy to.
FileStream KSP.IO.FileInfo.Create ( )
inline

Creates a file.

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

Create a text reader stream.

Template Parameters
TThe plugin type for which it is being initialized
Parameters
flightOptional flight
Returns
returns a PluginConfiguration object
TextWriter KSP.IO.FileInfo.CreateText ( )
inline

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

void KSP.IO.FileInfo.Decrypt ( )
inline

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

void KSP.IO.FileInfo.Delete ( )
inline

Permanently deletes a file.

void KSP.IO.FileInfo.Encrypt ( )
inline

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

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

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

Parameters
destFileNameThe path to move the file to, which can specify a different file name.
FileStream KSP.IO.FileInfo.Open ( FileMode  mode,
FileAccess  access 
)
inline

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

Parameters
accessA System.IO.FileAccess constant specifying whether to open the file with Read, Write, or ReadWrite file access.
modeA System.IO.FileMode constant specifying the mode (for example, Open or Append) in which to open the file.
FileStream KSP.IO.FileInfo.Open ( FileMode  mode)
inline

Opens a file in the specified mode.

Parameters
modeA KSP.IO.FileMode constant specifying the mode (for example, Open or Append) in which to open the file.
FileStream KSP.IO.FileInfo.Open ( FileMode  mode,
FileAccess  access,
FileShare  share 
)
inline

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

Parameters
accessA System.IO.FileAccess constant specifying whether to open the file with Read, Write, or ReadWrite file access.
shareA System.IO.FileShare constant specifying the type of access other FileStream objects have to this file.
modeA System.IO.FileMode constant specifying the mode (for example, Open or Append) in which to open the file.
FileStream KSP.IO.FileInfo.OpenRead ( )
inline

Creates a read-only System.IO.FileStream.

TextReader KSP.IO.FileInfo.OpenText ( )
inline

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

FileStream KSP.IO.FileInfo.OpenWrite ( )
inline

Creates a write-only System.IO.FileStream.

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

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
destinationBackupFileNameThe name of a file with which to create a backup of the file described by the destFileName parameter.
ignoreMetadataErrorstrue to ignore merge errors (such as attributes and ACLs) from the replaced file to the replacement file; otherwise false.
destinationFileNameThe name of a file to replace with the current file.
FileInfo KSP.IO.FileInfo.Replace ( string  destinationFileName,
string  destinationBackupFileName 
)
inline

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
destinationBackupFileNameThe name of a file with which to create a backup of the file described by the destFileName parameter.
destinationFileNameThe name of a file to replace with the current file.
override string KSP.IO.FileInfo.ToString ( )
inline

Returns the path as a string.

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: