Difference between revisions of "API:FileInfo"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (N3X15 moved page FileInfo to API:FileInfo)
Line 1: Line 1:
<!-- Autogenerated by WRAPTOOL.  Yell at N3X15 if it breaks. -->
+
<!-- Autogenerated by DOCTOOL.  Yell at N3X15 if it breaks. -->
 
{{Namespace:KSP.IO}}
 
{{Namespace:KSP.IO}}
 
{{Class
 
{{Class
Line 10: Line 10:
 
|returndesc=
 
|returndesc=
 
|name=CreateForType<T>
 
|name=CreateForType<T>
|args=string filename, Vessel flight = null
+
|args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}}
 
|desc=Create a text reader stream.
 
|desc=Create a text reader stream.
 
}}
 
}}
Line 17: Line 17:
 
|returndesc=
 
|returndesc=
 
|name=Replace
 
|name=Replace
|args=string destinationFileName, string destinationBackupFileName
+
|args={{arg|string|destinationFileName}}, {{arg|string|destinationBackupFileName}}
 
|desc=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.
 
|desc=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.
 
}}
 
}}
Line 45: Line 45:
 
|returndesc=
 
|returndesc=
 
|name=CopyTo
 
|name=CopyTo
|args=string destFileName, bool overwrite
+
|args={{arg|string|destFileName}}, {{arg|bool|overwrite}}
 
|desc=Copies an existing file to a new file, allowing the overwriting of an existing file.
 
|desc=Copies an existing file to a new file, allowing the overwriting of an existing file.
 
}}
 
}}
Line 52: Line 52:
 
|returndesc=
 
|returndesc=
 
|name=Open
 
|name=Open
|args=FileMode mode, FileAccess access
+
|args={{arg|FileMode|mode}}, {{arg|FileAccess|access}}
 
|desc=Opens a file in the specified mode with read, write, or read/write access.
 
|desc=Opens a file in the specified mode with read, write, or read/write access.
 
}}
 
}}
Line 66: Line 66:
 
|returndesc=
 
|returndesc=
 
|name=MoveTo
 
|name=MoveTo
|args=string destFileName
+
|args={{arg|string|destFileName}}
 
|desc=Moves a specified file to a new location, providing the option to specify a new file name.
 
|desc=Moves a specified file to a new location, providing the option to specify a new file name.
 
}}
 
}}
Line 80: Line 80:
 
|returndesc=
 
|returndesc=
 
|name=Open
 
|name=Open
|args=FileMode mode
+
|args={{arg|FileMode|mode}}
 
|desc=Opens a file in the specified mode.
 
|desc=Opens a file in the specified mode.
 
}}
 
}}
Line 115: Line 115:
 
|returndesc=
 
|returndesc=
 
|name=Open
 
|name=Open
|args=FileMode mode, FileAccess access, FileShare share
+
|args={{arg|FileMode|mode}}, {{arg|FileAccess|access}}, {{arg|FileShare|share}}
 
|desc=Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.
 
|desc=Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.
 
}}
 
}}
Line 129: Line 129:
 
|returndesc=
 
|returndesc=
 
|name=CopyTo
 
|name=CopyTo
|args=string destFileName
+
|args={{arg|string|destFileName}}
 
|desc=Copies an existing file to a new file, disallowing the overwriting of an existing file.
 
|desc=Copies an existing file to a new file, disallowing the overwriting of an existing file.
 
}}
 
}}
Line 136: Line 136:
 
|returndesc=
 
|returndesc=
 
|name=Replace
 
|name=Replace
|args=string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors
+
|args={{arg|string|destinationFileName}}, {{arg|string|destinationBackupFileName}}, {{arg|bool|ignoreMetadataErrors}}
 
|desc=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.
 
|desc=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.
 
}}
 
}}
 
{{MethodsEnd}}
 
{{MethodsEnd}}

Revision as of 21:37, 12 October 2012

KSP.IO Namespace
BinaryReader · BinaryWriter · File · FileInfo · FileStream · IOException · IOTools · IOUtils · MemoryStream · PluginConfigNode · PluginConfiguration · TextReader · TextWriter

FileInfo Class

A surrogate for System.IO.FileInfo.

Methods

The following are methods included in FileInfo.

Signature Description
static FileInfo CreateForType<T>(string filename, Vessel flight = null) Create a text reader stream.
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.
void Encrypt() Encrypts a file so that only the account used to encrypt the file can decrypt it.
void Delete() Permanently deletes a file.
FileStream Create() Creates a file.
FileInfo CopyTo(string destFileName, bool overwrite) Copies an existing file to a new file, allowing the overwriting of an existing file.
FileStream Open(FileMode mode, FileAccess access) Opens a file in the specified mode with read, write, or read/write access.
FileStream OpenWrite() Creates a write-only System.IO.FileStream.
void MoveTo(string destFileName) Moves a specified file to a new location, providing the option to specify a new file name.
TextWriter AppendText() Creates a System.IO.StreamWriter that appends text to the file represented by this instance of the System.IO.FileInfo.
FileStream Open(FileMode mode) Opens a file in the specified mode.
FileStream OpenRead() Creates a read-only System.IO.FileStream.
TextWriter CreateText() Creates a KSP.IO.TextWriter that writes a new text file.
string ToString() Returns the path as a string.
TextReader OpenText() Creates a System.IO.StreamReader with UTF8 encoding that reads from an existing text file.
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.
void Decrypt() Decrypts a file that was encrypted by the current account using the System.IO.FileInfo.Encrypt() method.
FileInfo CopyTo(string destFileName) Copies an existing file to a new file, disallowing the overwriting of an existing file.
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.