LocalFileSystem

Description

sealed class Tinman.Core.IO.Files.LocalFileSystem

Derived from

FileSystem abstract

An implementation of the IFileSystem interface for the local filesystem.

On Windows platforms, there is a filesystem root for each drive, e.g. c:\. On POSIX platforms, there is a single filesystem root /.

Public / Methods

File​Temp


[OwnerReturn]
public static method FileTemp → (2)

suffix opt : string = null

Optional file suffix (without '.').

temporary opt : bool = true

true to use FileFlags.Temporary,
false to use FileFlags.Create.

returns → IFile

The created file, in the Path.Temp directory.

Creates a temporary file in the local filesystem.

IOException

If an I/O error has occurred.

File​Temp​Path


[OwnerReturn]
public static method FileTempPath → (1)

suffix opt : string = null

Optional file suffix (without '.').

returns → Path

The created file path, in the Path.Temp directory.

Creates a temporary file path in the local filesystem.

The returned file path includes a pseudo-random component, which means that the path will point to a non-existing file in almost all cases. However, the calling code must be prepared for the case that a file already exists at the generated path and that is has been opened by another process. As best practice, the FileFlags.Create, FileFlags.NoShare and FileFlags.Temporary flags should be used to create the temporary file, which will generate a IOError.SharingViolation error if the file is already in use. Otherwise, the contents of the unused file will be overwritten.

IOException

If an I/O error has occurred.

Public / Attributes

Instance


public static attribute Instance → (get)

value : LocalFileSystem

[not-null]
The local filesystem.

Returns the local filesystem.

Logging

Logger


public static readonly attribute Logger → (ILogger)

The logger object of this class.