FileInfo

Description

struct Tinman.Core.IO.Files.FileInfo

Derived from

IEquatable<FileInfo>

Holds general information about a file.

See also

IFile.GetInfo

Public / Constants

Unknown


public static readonly attribute Unknown → (FileInfo)

Represents invalid / unknown file information.

Public / Constructors

File​Info


public constructor FileInfo → (4)

length in : int64

See Length.

timestamp in : int64

See Timestamp.

fullPath opt : Path = null

See Path. If null, Path.Unknown will be used.

contentHash opt : GUID = default(GUID)

See ContentHash.

Creates a new instance of FileInfo.

From​String


public static method FromString → (1)

value in : string

The string representation.

returns → FileInfo

The parsed FileInfo value or Unknown iff value in is malformed.

Creates a new instance of FileInfo from the given string representation.

Public / Methods

Equals

2 overloads


public method Equals2 → (3)

other in : FileInfo

The other FileInfo object.

fields in : int32

Chooses the field to include in the comparison:
1 : Length
2 : Timestamp
4 : FullPath
8 : ContentHash

timestamp opt : int32 = 0

[>=0]
If the timestamps of two files differ by this delta in milliseconds or less, the timestamps are considered to be equivalent.

returns → bool

true if the objects are equal, false if they are note.

Compares this FileInfo object with the given other in one.

Refresh


[Pure]
public method Refresh → (1)

hash opt : int32 = 0

Depicts how to refresh ContentHash:
< 0 : discard and set to GUID.Zero,
= 0 : refresh only if not GUID.Zero,
> 0 : always refresh

returns → FileInfo

The refreshed file info.

Refreshes this file info.

IOException

If an I/O error has occurred.

Public / Attributes

Content​Hash


public readonly attribute ContentHash → (GUID)

The MD5 hash of the file content.

The value GUID.Zero indicates that the file hash has not been computed.

See also

FileInfo.Refresh

Full​Path


public attribute FullPath → (get)

value : Path

[not-null]
The file path.

The canonical path to the file or Path.Unknown.

Is​Unknown


public attribute IsUnknown → (get)

value : bool

true if this file information in invalid,
false if it is valid.

Is this file information invalid / unknown?

See also

FileInfo.Unknown

Length


public readonly attribute Length → (int64)

The file size, in bytes.

See also

IFile.GetLength

Timestamp


public readonly attribute Timestamp → (int64)

The file timestamp (last modification).