Table of Contents

Interface File

Namespace
Gio
Assembly
Gio-2.0.dll
public interface File : IHandle
Inherited Members

Methods

AppendTo(FileCreateFlags, Cancellable?)

FileOutputStream AppendTo(FileCreateFlags flags, Cancellable? cancellable)

Parameters

flags FileCreateFlags
cancellable Cancellable

Returns

FileOutputStream

AppendToFinish(AsyncResult)

FileOutputStream AppendToFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileOutputStream

BuildAttributeListForCopy(FileCopyFlags, Cancellable?)

[Version("2.68")]
string BuildAttributeListForCopy(FileCopyFlags flags, Cancellable? cancellable)

Parameters

flags FileCopyFlags
cancellable Cancellable

Returns

string

Copy(File, FileCopyFlags, Cancellable?, FileProgressCallback?)

bool Copy(File destination, FileCopyFlags flags, Cancellable? cancellable, FileProgressCallback? progressCallback)

Parameters

destination File
flags FileCopyFlags
cancellable Cancellable
progressCallback FileProgressCallback

Returns

bool

CopyAttributes(File, FileCopyFlags, Cancellable?)

bool CopyAttributes(File destination, FileCopyFlags flags, Cancellable? cancellable)

Parameters

destination File
flags FileCopyFlags
cancellable Cancellable

Returns

bool

CopyFinish(AsyncResult)

bool CopyFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

bool

Create(FileCreateFlags, Cancellable?)

FileOutputStream Create(FileCreateFlags flags, Cancellable? cancellable)

Parameters

flags FileCreateFlags
cancellable Cancellable

Returns

FileOutputStream

CreateFinish(AsyncResult)

FileOutputStream CreateFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileOutputStream

CreateReadwrite(FileCreateFlags, Cancellable?)

[Version("2.22")]
FileIOStream CreateReadwrite(FileCreateFlags flags, Cancellable? cancellable)

Parameters

flags FileCreateFlags
cancellable Cancellable

Returns

FileIOStream

CreateReadwriteFinish(AsyncResult)

[Version("2.22")]
FileIOStream CreateReadwriteFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileIOStream

Delete(Cancellable?)

bool Delete(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

bool

DeleteFinish(AsyncResult)

[Version("2.34")]
bool DeleteFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

Dup()

File Dup()

Returns

File

EjectMountableFinish(AsyncResult)

bool EjectMountableFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

EjectMountableWithOperationFinish(AsyncResult)

[Version("2.22")]
bool EjectMountableWithOperationFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

EnumerateChildren(string, FileQueryInfoFlags, Cancellable?)

FileEnumerator EnumerateChildren(string attributes, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

attributes string
flags FileQueryInfoFlags
cancellable Cancellable

Returns

FileEnumerator

EnumerateChildrenFinish(AsyncResult)

FileEnumerator EnumerateChildrenFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileEnumerator

Equal(File)

bool Equal(File file2)

Parameters

file2 File

Returns

bool

FindEnclosingMount(Cancellable?)

Mount FindEnclosingMount(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

Mount

FindEnclosingMountFinish(AsyncResult)

Mount FindEnclosingMountFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

Mount

GetBasename()

string? GetBasename()

Returns

string

GetChild(string)

File GetChild(string name)

Parameters

name string

Returns

File

GetChildForDisplayName(string)

File GetChildForDisplayName(string displayName)

Parameters

displayName string

Returns

File

GetParent()

File? GetParent()

Returns

File

GetParseName()

string GetParseName()

Returns

string

GetPath()

string? GetPath()

Returns

string

GetRelativePath(File)

string? GetRelativePath(File descendant)

Parameters

descendant File

Returns

string

GetUri()

string GetUri()

Returns

string

GetUriScheme()

string? GetUriScheme()

Returns

string

HasParent(File?)

[Version("2.24")]
bool HasParent(File? parent)

Parameters

parent File

Returns

bool

HasPrefix(File)

bool HasPrefix(File prefix)

Parameters

prefix File

Returns

bool

HasUriScheme(string)

bool HasUriScheme(string uriScheme)

Parameters

uriScheme string

Returns

bool

Hash()

uint Hash()

Returns

uint

IsNative()

bool IsNative()

Returns

bool

LoadBytes(Cancellable?, out string?)

[Version("2.56")]
Bytes LoadBytes(Cancellable? cancellable, out string? etagOut)

Parameters

cancellable Cancellable
etagOut string

Returns

Bytes

LoadBytesFinish(AsyncResult, out string?)

[Version("2.56")]
Bytes LoadBytesFinish(AsyncResult result, out string? etagOut)

Parameters

result AsyncResult
etagOut string

Returns

Bytes

MakeDirectory(Cancellable?)

bool MakeDirectory(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

bool

MakeDirectoryFinish(AsyncResult)

[Version("2.38")]
bool MakeDirectoryFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

MakeDirectoryWithParents(Cancellable?)

[Version("2.18")]
bool MakeDirectoryWithParents(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

bool
bool MakeSymbolicLink(string symlinkValue, Cancellable? cancellable)

Parameters

symlinkValue string
cancellable Cancellable

Returns

bool

MakeSymbolicLinkFinish(AsyncResult)

[Version("2.74")]
bool MakeSymbolicLinkFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

MeasureDiskUsage(FileMeasureFlags, Cancellable?, FileMeasureProgressCallback?, out ulong, out ulong, out ulong)

[Version("2.38")]
bool MeasureDiskUsage(FileMeasureFlags flags, Cancellable? cancellable, FileMeasureProgressCallback? progressCallback, out ulong diskUsage, out ulong numDirs, out ulong numFiles)

Parameters

flags FileMeasureFlags
cancellable Cancellable
progressCallback FileMeasureProgressCallback
diskUsage ulong
numDirs ulong
numFiles ulong

Returns

bool

MeasureDiskUsageFinish(AsyncResult, out ulong, out ulong, out ulong)

[Version("2.38")]
bool MeasureDiskUsageFinish(AsyncResult result, out ulong diskUsage, out ulong numDirs, out ulong numFiles)

Parameters

result AsyncResult
diskUsage ulong
numDirs ulong
numFiles ulong

Returns

bool

Monitor(FileMonitorFlags, Cancellable?)

[Version("2.18")]
FileMonitor Monitor(FileMonitorFlags flags, Cancellable? cancellable)

Parameters

flags FileMonitorFlags
cancellable Cancellable

Returns

FileMonitor

MonitorDirectory(FileMonitorFlags, Cancellable?)

FileMonitor MonitorDirectory(FileMonitorFlags flags, Cancellable? cancellable)

Parameters

flags FileMonitorFlags
cancellable Cancellable

Returns

FileMonitor

MonitorFile(FileMonitorFlags, Cancellable?)

FileMonitor MonitorFile(FileMonitorFlags flags, Cancellable? cancellable)

Parameters

flags FileMonitorFlags
cancellable Cancellable

Returns

FileMonitor

MountEnclosingVolumeFinish(AsyncResult)

bool MountEnclosingVolumeFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

MountMountableFinish(AsyncResult)

File MountMountableFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

File

Move(File, FileCopyFlags, Cancellable?, FileProgressCallback?)

bool Move(File destination, FileCopyFlags flags, Cancellable? cancellable, FileProgressCallback? progressCallback)

Parameters

destination File
flags FileCopyFlags
cancellable Cancellable
progressCallback FileProgressCallback

Returns

bool

MoveFinish(AsyncResult)

[Version("2.72")]
bool MoveFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

OpenReadwrite(Cancellable?)

[Version("2.22")]
FileIOStream OpenReadwrite(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

FileIOStream

OpenReadwriteFinish(AsyncResult)

[Version("2.22")]
FileIOStream OpenReadwriteFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileIOStream

PeekPath()

[Version("2.56")]
string? PeekPath()

Returns

string

PollMountableFinish(AsyncResult)

[Version("2.22")]
bool PollMountableFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

QueryDefaultHandler(Cancellable?)

AppInfo QueryDefaultHandler(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

AppInfo

QueryDefaultHandlerFinish(AsyncResult)

[Version("2.60")]
AppInfo QueryDefaultHandlerFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

AppInfo

QueryExists(Cancellable?)

bool QueryExists(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

bool

QueryFileType(FileQueryInfoFlags, Cancellable?)

[Version("2.18")]
FileType QueryFileType(FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

flags FileQueryInfoFlags
cancellable Cancellable

Returns

FileType

QueryFilesystemInfo(string, Cancellable?)

FileInfo QueryFilesystemInfo(string attributes, Cancellable? cancellable)

Parameters

attributes string
cancellable Cancellable

Returns

FileInfo

QueryFilesystemInfoFinish(AsyncResult)

FileInfo QueryFilesystemInfoFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileInfo

QueryInfo(string, FileQueryInfoFlags, Cancellable?)

FileInfo QueryInfo(string attributes, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

attributes string
flags FileQueryInfoFlags
cancellable Cancellable

Returns

FileInfo

QueryInfoFinish(AsyncResult)

FileInfo QueryInfoFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileInfo

QuerySettableAttributes(Cancellable?)

FileAttributeInfoList QuerySettableAttributes(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

FileAttributeInfoList

QueryWritableNamespaces(Cancellable?)

FileAttributeInfoList QueryWritableNamespaces(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

FileAttributeInfoList

Read(Cancellable?)

FileInputStream Read(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

FileInputStream

ReadFinish(AsyncResult)

FileInputStream ReadFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileInputStream

Replace(string?, bool, FileCreateFlags, Cancellable?)

FileOutputStream Replace(string? etag, bool makeBackup, FileCreateFlags flags, Cancellable? cancellable)

Parameters

etag string
makeBackup bool
flags FileCreateFlags
cancellable Cancellable

Returns

FileOutputStream

ReplaceContents(Span<byte>, string?, bool, FileCreateFlags, out string?, Cancellable?)

bool ReplaceContents(Span<byte> contents, string? etag, bool makeBackup, FileCreateFlags flags, out string? newEtag, Cancellable? cancellable)

Parameters

contents Span<byte>
etag string
makeBackup bool
flags FileCreateFlags
newEtag string
cancellable Cancellable

Returns

bool

ReplaceContentsFinish(AsyncResult, out string?)

bool ReplaceContentsFinish(AsyncResult res, out string? newEtag)

Parameters

res AsyncResult
newEtag string

Returns

bool

ReplaceFinish(AsyncResult)

FileOutputStream ReplaceFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileOutputStream

ReplaceReadwrite(string?, bool, FileCreateFlags, Cancellable?)

[Version("2.22")]
FileIOStream ReplaceReadwrite(string? etag, bool makeBackup, FileCreateFlags flags, Cancellable? cancellable)

Parameters

etag string
makeBackup bool
flags FileCreateFlags
cancellable Cancellable

Returns

FileIOStream

ReplaceReadwriteFinish(AsyncResult)

[Version("2.22")]
FileIOStream ReplaceReadwriteFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

FileIOStream

ResolveRelativePath(string)

File ResolveRelativePath(string relativePath)

Parameters

relativePath string

Returns

File

SetAttribute(string, FileAttributeType, IntPtr, FileQueryInfoFlags, Cancellable?)

bool SetAttribute(string attribute, FileAttributeType type, IntPtr valueP, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

attribute string
type FileAttributeType
valueP IntPtr
flags FileQueryInfoFlags
cancellable Cancellable

Returns

bool

SetAttributeByteString(string, string, FileQueryInfoFlags, Cancellable?)

bool SetAttributeByteString(string attribute, string value, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

attribute string
value string
flags FileQueryInfoFlags
cancellable Cancellable

Returns

bool

SetAttributeInt32(string, int, FileQueryInfoFlags, Cancellable?)

bool SetAttributeInt32(string attribute, int value, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

attribute string
value int
flags FileQueryInfoFlags
cancellable Cancellable

Returns

bool

SetAttributeInt64(string, long, FileQueryInfoFlags, Cancellable?)

bool SetAttributeInt64(string attribute, long value, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

attribute string
value long
flags FileQueryInfoFlags
cancellable Cancellable

Returns

bool

SetAttributeString(string, string, FileQueryInfoFlags, Cancellable?)

bool SetAttributeString(string attribute, string value, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

attribute string
value string
flags FileQueryInfoFlags
cancellable Cancellable

Returns

bool

SetAttributeUint32(string, uint, FileQueryInfoFlags, Cancellable?)

bool SetAttributeUint32(string attribute, uint value, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

attribute string
value uint
flags FileQueryInfoFlags
cancellable Cancellable

Returns

bool

SetAttributeUint64(string, ulong, FileQueryInfoFlags, Cancellable?)

bool SetAttributeUint64(string attribute, ulong value, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

attribute string
value ulong
flags FileQueryInfoFlags
cancellable Cancellable

Returns

bool

SetAttributesFromInfo(FileInfo, FileQueryInfoFlags, Cancellable?)

bool SetAttributesFromInfo(FileInfo info, FileQueryInfoFlags flags, Cancellable? cancellable)

Parameters

info FileInfo
flags FileQueryInfoFlags
cancellable Cancellable

Returns

bool

SetDisplayName(string, Cancellable?)

File SetDisplayName(string displayName, Cancellable? cancellable)

Parameters

displayName string
cancellable Cancellable

Returns

File

SetDisplayNameFinish(AsyncResult)

File SetDisplayNameFinish(AsyncResult res)

Parameters

res AsyncResult

Returns

File

StartMountableFinish(AsyncResult)

[Version("2.22")]
bool StartMountableFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

StopMountableFinish(AsyncResult)

[Version("2.22")]
bool StopMountableFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

SupportsThreadContexts()

[Version("2.22")]
bool SupportsThreadContexts()

Returns

bool

Trash(Cancellable?)

bool Trash(Cancellable? cancellable)

Parameters

cancellable Cancellable

Returns

bool

TrashFinish(AsyncResult)

[Version("2.38")]
bool TrashFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

UnmountMountableFinish(AsyncResult)

bool UnmountMountableFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool

UnmountMountableWithOperationFinish(AsyncResult)

[Version("2.22")]
bool UnmountMountableWithOperationFinish(AsyncResult result)

Parameters

result AsyncResult

Returns

bool