Difference between revisions of "API:File"
From Kerbal Space Program Wiki
Line 1: | Line 1: | ||
− | <!-- Autogenerated by | + | <!-- Autogenerated by DOCTOOL. Yell at N3X15 if it breaks. --> |
{{Namespace:KSP.IO}} | {{Namespace:KSP.IO}} | ||
{{Class | {{Class | ||
Line 10: | Line 10: | ||
|returndesc= | |returndesc= | ||
|name=Exists<T> | |name=Exists<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Find out if a file in your IO sandbox exists. | |desc=Find out if a file in your IO sandbox exists. | ||
}} | }} | ||
Line 17: | Line 17: | ||
|returndesc= | |returndesc= | ||
|name=Open<T> | |name=Open<T> | ||
− | |args=string filename, KSP.IO.FileMode mode, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|KSP.IO.FileMode|mode}}, {{arg|Vessel|flight|default=null}} |
|desc=Open a stream that operates on a file. | |desc=Open a stream that operates on a file. | ||
}} | }} | ||
Line 24: | Line 24: | ||
|returndesc= | |returndesc= | ||
|name=OpenWrite<T> | |name=OpenWrite<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Open a stream that writes to a file. | |desc=Open a stream that writes to a file. | ||
}} | }} | ||
Line 31: | Line 31: | ||
|returndesc= | |returndesc= | ||
|name=WriteAllText<T> | |name=WriteAllText<T> | ||
− | |args=string data, string filename, Vessel flight = null | + | |args={{arg|string|data}}, {{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Write a string to a file. | |desc=Write a string to a file. | ||
}} | }} | ||
Line 38: | Line 38: | ||
|returndesc= | |returndesc= | ||
|name=AppendAllText<T> | |name=AppendAllText<T> | ||
− | |args=string data, string filename, Vessel flight = null | + | |args={{arg|string|data}}, {{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Append a string to a file, or creates it if it doesn't exist. | |desc=Append a string to a file, or creates it if it doesn't exist. | ||
}} | }} | ||
Line 45: | Line 45: | ||
|returndesc= | |returndesc= | ||
|name=AppendText<T> | |name=AppendText<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Open a stream that appends to a file. | |desc=Open a stream that appends to a file. | ||
}} | }} | ||
Line 52: | Line 52: | ||
|returndesc= | |returndesc= | ||
|name=Delete<T> | |name=Delete<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Delete a file in your IO sandbox. | |desc=Delete a file in your IO sandbox. | ||
}} | }} | ||
{{StaticMethod | {{StaticMethod | ||
− | |returntype=string[] | + | |returntype=string |
+ | |array=[] | ||
|returndesc= | |returndesc= | ||
|name=ReadAllLines<T> | |name=ReadAllLines<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Read all lines from a file in your IO sandbox. | |desc=Read all lines from a file in your IO sandbox. | ||
}} | }} | ||
Line 66: | Line 67: | ||
|returndesc= | |returndesc= | ||
|name=OpenText<T> | |name=OpenText<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Open a stream that operates on a file. | |desc=Open a stream that operates on a file. | ||
}} | }} | ||
{{StaticMethod | {{StaticMethod | ||
− | |returntype=byte[] | + | |returntype=byte |
+ | |array=[] | ||
|returndesc= | |returndesc= | ||
|name=ReadAllBytes<T> | |name=ReadAllBytes<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Read all the bytes from a file in your IO sandbox. | |desc=Read all the bytes from a file in your IO sandbox. | ||
}} | }} | ||
Line 80: | Line 82: | ||
|returndesc= | |returndesc= | ||
|name=CreateText<T> | |name=CreateText<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Open a stream that creates a file. | |desc=Open a stream that creates a file. | ||
}} | }} | ||
Line 87: | Line 89: | ||
|returndesc= | |returndesc= | ||
|name=WriteAllBytes<T> | |name=WriteAllBytes<T> | ||
− | |args=byte[] | + | |args={{arg|byte|data|array=[]}}, {{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Write a bunch of bytes to a file on disk | |desc=Write a bunch of bytes to a file on disk | ||
}} | }} | ||
Line 94: | Line 96: | ||
|returndesc= | |returndesc= | ||
|name=WriteAllLines<T> | |name=WriteAllLines<T> | ||
− | |args=string[] | + | |args={{arg|string|data|array=[]}}, {{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Write an array of strings to a file, with each string becoming a line. | |desc=Write an array of strings to a file, with each string becoming a line. | ||
}} | }} | ||
Line 101: | Line 103: | ||
|returndesc= | |returndesc= | ||
|name=ReadAllText<T> | |name=ReadAllText<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Read all the text from a file in your IO sandbox. | |desc=Read all the text from a file in your IO sandbox. | ||
}} | }} | ||
Line 108: | Line 110: | ||
|returndesc= | |returndesc= | ||
|name=Create<T> | |name=Create<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Open a stream that creates a file. | |desc=Open a stream that creates a file. | ||
}} | }} | ||
{{MethodsEnd}} | {{MethodsEnd}} |
Latest revision as of 21:35, 12 October 2012
KSP.IO Namespace
BinaryReader ·
BinaryWriter ·
File ·
FileInfo ·
FileStream ·
IOException ·
IOTools ·
IOUtils ·
MemoryStream ·
PluginConfigNode ·
PluginConfiguration ·
TextReader ·
TextWriter
File Class
summary goes here
Methods
The following are methods included in File.
Signature | Description |
---|---|
static bool Exists<T>(string filename, Vessel flight = null) | Find out if a file in your IO sandbox exists. |
static KSP.IO.FileStream Open<T>(string filename, KSP.IO.FileMode mode, Vessel flight = null) | Open a stream that operates on a file. |
static KSP.IO.FileStream OpenWrite<T>(string filename, Vessel flight = null) | Open a stream that writes to a file. |
static void WriteAllText<T>(string data, string filename, Vessel flight = null) | Write a string to a file. |
static void AppendAllText<T>(string data, string filename, Vessel flight = null) | Append a string to a file, or creates it if it doesn't exist. |
static KSP.IO.TextWriter AppendText<T>(string filename, Vessel flight = null) | Open a stream that appends to a file. |
static void Delete<T>(string filename, Vessel flight = null) | Delete a file in your IO sandbox. |
static string[] ReadAllLines<T>(string filename, Vessel flight = null) | Read all lines from a file in your IO sandbox. |
static KSP.IO.TextReader OpenText<T>(string filename, Vessel flight = null) | Open a stream that operates on a file. |
static byte[] ReadAllBytes<T>(string filename, Vessel flight = null) | Read all the bytes from a file in your IO sandbox. |
static KSP.IO.TextWriter CreateText<T>(string filename, Vessel flight = null) | Open a stream that creates a file. |
static void WriteAllBytes<T>(byte[] data, string filename, Vessel flight = null) | Write a bunch of bytes to a file on disk |
static void WriteAllLines<T>(string[] data, string filename, Vessel flight = null) | Write an array of strings to a file, with each string becoming a line. |
static string ReadAllText<T>(string filename, Vessel flight = null) | Read all the text from a file in your IO sandbox. |
static KSP.IO.FileStream Create<T>(string filename, Vessel flight = null) | Open a stream that creates a file. |