Interface IReadOnlyFile
Represents a read only view over a file contained within an IDirectory that could have
metadata potentially attached to it by a unique System.
Prefer using the IRead
Namespace: Snowflake.Filesystem
Assembly: Snowflake.Framework.Primitives.dll
Syntax
public interface IReadOnlyFile
Properties
Created
Whether or not this file has been created or currently exists.
Keep in mind that
Declaration
bool Created { get; }
Property Value
| Type | Description |
|---|---|
| System. |
FileGuid
The unique ID identifying this file in the directory manifest.
Declaration
Guid FileGuid { get; }
Property Value
| Type | Description |
|---|---|
| System. |
IsLink
Whether or not this file is a link.
Declaration
bool IsLink { get; }
Property Value
| Type | Description |
|---|---|
| System. |
Length
The length of the file in bytes. If the file does not yet exist, this value is -1.
Declaration
long Length { get; }
Property Value
| Type | Description |
|---|---|
| System. |
Name
The name of the file.
Declaration
string Name { get; }
Property Value
| Type | Description |
|---|---|
| System. |
ParentDirectory
The IDirectory under which this file is located.
Declaration
IReadOnlyDirectory ParentDirectory { get; }
Property Value
| Type | Description |
|---|---|
| IRead |
RootedPath
The path of this file, relative to the root of the directory provider.
Declaration
string RootedPath { get; }
Property Value
| Type | Description |
|---|---|
| System. |
Methods
OpenReadStream()
Opens a read-only stream to the file. If it does not currently exist,
System.
Declaration
Stream OpenReadStream()
Returns
| Type | Description |
|---|---|
| System. |
A read-write stream to the file. |
UnsafeGetFilePath()
Returns the real file path of this file.
This method is obsolete because it is unsafe to use, without going through the interface methods of IFile, there is no guarantee that the parent IDirectory instance will remain consistent.
However, access to the underlying filesystem is necessary for the API to be remotely useful at the barrier.
If Is
Restrict usage to read-only unless absolutely necessary.
Declaration
[Obsolete("Avoid accessing the underlying file path, and use the object methods instead.")]
FileInfo UnsafeGetFilePath()
Returns
| Type | Description |
|---|---|
| System. |
The real file path of the file. |