Method ToCachedInfo
ToCachedInfo(FileInfo, PathOptions)
Creates a cached info snapshot for the file represented by the FileInfo using the specified options.
Declaration
public static CachedFileInfo ToCachedInfo(this FileInfo fileInfo, PathOptions options = PathOptions.NoUnfriendlyNames)
Parameters
| Type | Name | Description |
|---|---|---|
| FileInfo | fileInfo | |
| PathOptions | options |
Returns
| Type | Description |
|---|---|
| CachedFileInfo |
Remarks
The FullName property is used to get the absolute path that is parsed.
Exceptions
| Type | Condition |
|---|---|
| FileNotFoundException | No file exists at the specified path. |
| IOException | The path resolves to a directory instead of a file. |
ToCachedInfo(DirectoryInfo, PathOptions)
Creates a cached info snapshot for the directory represented by the DirectoryInfo using the specified options.
Declaration
public static CachedDirectoryInfo ToCachedInfo(this DirectoryInfo dirInfo, PathOptions options = PathOptions.NoUnfriendlyNames)
Parameters
| Type | Name | Description |
|---|---|---|
| DirectoryInfo | dirInfo | |
| PathOptions | options |
Returns
| Type | Description |
|---|---|
| CachedDirectoryInfo |
Remarks
The FullName property is used to get the absolute path that is parsed.
Exceptions
| Type | Condition |
|---|---|
| FileNotFoundException | No directory exists at the specified path. |
| IOException | The path resolves to a file instead of a directory. |
ToCachedInfo(FileSystemInfo, PathOptions)
Creates a cached info snapshot for the file or directory represented by the FileSystemInfo using the specified options. The returned
instance is either a CachedFileInfo or CachedDirectoryInfo depending on the runtime type of info.
Declaration
public static CachedEntryInfo ToCachedInfo(this FileSystemInfo info, PathOptions options = PathOptions.NoUnfriendlyNames)
Parameters
| Type | Name | Description |
|---|---|---|
| FileSystemInfo | info | |
| PathOptions | options |
Returns
| Type | Description |
|---|---|
| CachedEntryInfo |
Remarks
The FullName property is used to get the absolute path that is parsed.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| FileNotFoundException | No file or directory exists at the specified path. |
| IOException | The entry's type does not match the runtime type of |