Class TempFileHelper
Inherited Members
Namespace: Acoustics.Shared
Assembly: Acoustics.Shared.dll
Syntax
public static class TempFileHelper
Methods
| Improve this Doc View SourceCopyFromStream(Stream, FileInfo, Boolean)
Copy from source
Stream to Working File.
Declaration
public static void CopyFromStream(this Stream source, FileInfo destinationFile, bool append = false)
Parameters
Type | Name | Description |
---|---|---|
Stream | source | The source stream. |
FileInfo | destinationFile | File to write to. |
Boolean | append | True to append to existing file, false to replace any existing data in file. |
NewTempFile()
Gets a temporary file location. File will be 8.3 (eg. abcdefgh.ijk). File will not exist.
Declaration
public static FileInfo NewTempFile()
Returns
Type | Description |
---|---|
FileInfo |
NewTempFile(DirectoryInfo)
Gets a temporary file location. File will be 8.3 (eg. abcdefgh.ijk). File will not exist.
Declaration
public static FileInfo NewTempFile(DirectoryInfo tempDir)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | tempDir | Temporary directory. |
Returns
Type | Description |
---|---|
FileInfo | Temp file that does not exist. |
NewTempFile(DirectoryInfo, String)
Gets a temporary file location. File will be 8.3 (eg. abcdefgh.[given ext]). File will not exist.
Declaration
public static FileInfo NewTempFile(DirectoryInfo tempDir, string extension)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | tempDir | Temporary directory. |
String | extension |
Returns
Type | Description |
---|---|
FileInfo | File with extension. |
NewTempFile(String)
Gets a temporary file location. File will be 8.3 (eg. abcdefgh.[given ext]). File will not exist.
Declaration
public static FileInfo NewTempFile(string extension)
Parameters
Type | Name | Description |
---|---|---|
String | extension | File extension (without dot). |
Returns
Type | Description |
---|---|
FileInfo | File with extension. |
TempDir(Boolean)
Gets a valid temp directory. Directory will exist.
Declaration
public static DirectoryInfo TempDir(bool ensureNew = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | ensureNew |
Returns
Type | Description |
---|---|
DirectoryInfo |