Class FileHelper
- Namespace
- Gio
- Assembly
- Gio-2.0.dll
public sealed class FileHelper : Object, File, NativeObject, IDisposable, InstanceFactory, GTypeProvider
- Inheritance
-
FileHelper
- Implements
- Inherited Members
Methods
AppendTo(FileCreateFlags, Cancellable?)
public FileOutputStream AppendTo(FileCreateFlags flags, Cancellable? cancellable)
Parameters
flagsFileCreateFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
AppendToFinish(AsyncResult)
public FileOutputStream AppendToFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
BuildAttributeListForCopy(FileCopyFlags, Cancellable?)
[Version("2.68")]
public string BuildAttributeListForCopy(FileCopyFlags flags, Cancellable? cancellable)
Parameters
flagsFileCopyFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
Copy(File, FileCopyFlags, Cancellable?, FileProgressCallback?)
public bool Copy(File destination, FileCopyFlags flags, Cancellable? cancellable, FileProgressCallback? progressCallback)
Parameters
destinationFileflagsFileCopyFlagscancellableCancellableprogressCallbackFileProgressCallbackA callback. If it raises an exception the application will terminate. To receive this unhandled exception see SetHandler(Action<Exception>?).
Returns
Exceptions
- GException
Throws a GException in case of an error.
CopyAsync(File, FileCopyFlags, int, Cancellable?, Closure?, Closure)
[Version("2.82")]
public void CopyAsync(File destination, FileCopyFlags flags, int ioPriority, Cancellable? cancellable, Closure? progressCallbackClosure, Closure readyCallbackClosure)
Parameters
destinationFileflagsFileCopyFlagsioPriorityintcancellableCancellableprogressCallbackClosureClosurereadyCallbackClosureClosure
CopyAttributes(File, FileCopyFlags, Cancellable?)
public bool CopyAttributes(File destination, FileCopyFlags flags, Cancellable? cancellable)
Parameters
destinationFileflagsFileCopyFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
CopyFinish(AsyncResult)
public bool CopyFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
Create(FileCreateFlags, Cancellable?)
public FileOutputStream Create(FileCreateFlags flags, Cancellable? cancellable)
Parameters
flagsFileCreateFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
CreateFinish(AsyncResult)
public FileOutputStream CreateFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
CreateReadwrite(FileCreateFlags, Cancellable?)
[Version("2.22")]
public FileIOStream CreateReadwrite(FileCreateFlags flags, Cancellable? cancellable)
Parameters
flagsFileCreateFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
CreateReadwriteFinish(AsyncResult)
[Version("2.22")]
public FileIOStream CreateReadwriteFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
Delete(Cancellable?)
public bool Delete(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
DeleteFinish(AsyncResult)
[Version("2.34")]
public bool DeleteFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
Dup()
public File Dup()
Returns
EjectMountableFinish(AsyncResult)
public bool EjectMountableFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
EjectMountableWithOperationFinish(AsyncResult)
[Version("2.22")]
public bool EjectMountableWithOperationFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
EnumerateChildren(string, FileQueryInfoFlags, Cancellable?)
public FileEnumerator EnumerateChildren(string attributes, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
attributesstringflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
EnumerateChildrenFinish(AsyncResult)
public FileEnumerator EnumerateChildrenFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
Equal(File)
public bool Equal(File file2)
Parameters
file2File
Returns
FindEnclosingMount(Cancellable?)
public Mount FindEnclosingMount(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
FindEnclosingMountFinish(AsyncResult)
public Mount FindEnclosingMountFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
GetBasename()
public string? GetBasename()
Returns
GetChild(string)
public File GetChild(string name)
Parameters
namestring
Returns
GetChildForDisplayName(string)
public File GetChildForDisplayName(string displayName)
Parameters
displayNamestring
Returns
Exceptions
- GException
Throws a GException in case of an error.
GetGType()
public static Type GetGType()
Returns
GetParent()
public File? GetParent()
Returns
GetParseName()
public string GetParseName()
Returns
GetPath()
public string? GetPath()
Returns
GetRelativePath(File)
public string? GetRelativePath(File descendant)
Parameters
descendantFile
Returns
GetUri()
public string GetUri()
Returns
GetUriScheme()
public string? GetUriScheme()
Returns
HasParent(File?)
[Version("2.24")]
public bool HasParent(File? parent)
Parameters
parentFile
Returns
HasPrefix(File)
public bool HasPrefix(File prefix)
Parameters
prefixFile
Returns
HasUriScheme(string)
public bool HasUriScheme(string uriScheme)
Parameters
uriSchemestring
Returns
Hash()
public uint Hash()
Returns
IsNative()
public bool IsNative()
Returns
LoadBytes(Cancellable?, out string?)
[Version("2.56")]
public Bytes LoadBytes(Cancellable? cancellable, out string? etagOut)
Parameters
cancellableCancellableetagOutstring
Returns
Exceptions
- GException
Throws a GException in case of an error.
LoadBytesFinish(AsyncResult, out string?)
[Version("2.56")]
public Bytes LoadBytesFinish(AsyncResult result, out string? etagOut)
Parameters
resultAsyncResultetagOutstring
Returns
Exceptions
- GException
Throws a GException in case of an error.
MakeDirectory(Cancellable?)
public bool MakeDirectory(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
MakeDirectoryFinish(AsyncResult)
[Version("2.38")]
public bool MakeDirectoryFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
MakeDirectoryWithParents(Cancellable?)
[Version("2.18")]
public bool MakeDirectoryWithParents(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
MakeSymbolicLink(string, Cancellable?)
public bool MakeSymbolicLink(string symlinkValue, Cancellable? cancellable)
Parameters
symlinkValuestringcancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
MakeSymbolicLinkFinish(AsyncResult)
[Version("2.74")]
public bool MakeSymbolicLinkFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
MeasureDiskUsage(FileMeasureFlags, Cancellable?, FileMeasureProgressCallback?, out ulong, out ulong, out ulong)
[Version("2.38")]
public bool MeasureDiskUsage(FileMeasureFlags flags, Cancellable? cancellable, FileMeasureProgressCallback? progressCallback, out ulong diskUsage, out ulong numDirs, out ulong numFiles)
Parameters
flagsFileMeasureFlagscancellableCancellableprogressCallbackFileMeasureProgressCallbackA callback. If it raises an exception the application will terminate. To receive this unhandled exception see SetHandler(Action<Exception>?).
diskUsageulongnumDirsulongnumFilesulong
Returns
Exceptions
- GException
Throws a GException in case of an error.
MeasureDiskUsageFinish(AsyncResult, out ulong, out ulong, out ulong)
[Version("2.38")]
public bool MeasureDiskUsageFinish(AsyncResult result, out ulong diskUsage, out ulong numDirs, out ulong numFiles)
Parameters
resultAsyncResultdiskUsageulongnumDirsulongnumFilesulong
Returns
Exceptions
- GException
Throws a GException in case of an error.
Monitor(FileMonitorFlags, Cancellable?)
[Version("2.18")]
public FileMonitor Monitor(FileMonitorFlags flags, Cancellable? cancellable)
Parameters
flagsFileMonitorFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
MonitorDirectory(FileMonitorFlags, Cancellable?)
public FileMonitor MonitorDirectory(FileMonitorFlags flags, Cancellable? cancellable)
Parameters
flagsFileMonitorFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
MonitorFile(FileMonitorFlags, Cancellable?)
public FileMonitor MonitorFile(FileMonitorFlags flags, Cancellable? cancellable)
Parameters
flagsFileMonitorFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
MountEnclosingVolumeFinish(AsyncResult)
public bool MountEnclosingVolumeFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
MountMountableFinish(AsyncResult)
public File MountMountableFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
Move(File, FileCopyFlags, Cancellable?, FileProgressCallback?)
public bool Move(File destination, FileCopyFlags flags, Cancellable? cancellable, FileProgressCallback? progressCallback)
Parameters
destinationFileflagsFileCopyFlagscancellableCancellableprogressCallbackFileProgressCallbackA callback. If it raises an exception the application will terminate. To receive this unhandled exception see SetHandler(Action<Exception>?).
Returns
Exceptions
- GException
Throws a GException in case of an error.
MoveAsync(File, FileCopyFlags, int, Cancellable?, Closure?, Closure)
[Version("2.82")]
public void MoveAsync(File destination, FileCopyFlags flags, int ioPriority, Cancellable? cancellable, Closure? progressCallbackClosure, Closure readyCallbackClosure)
Parameters
destinationFileflagsFileCopyFlagsioPriorityintcancellableCancellableprogressCallbackClosureClosurereadyCallbackClosureClosure
MoveFinish(AsyncResult)
[Version("2.72")]
public bool MoveFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
NewBuildFilenamev(string[])
[Version("2.78")]
public static File NewBuildFilenamev(string[] args)
Parameters
argsstring[]
Returns
NewForCommandlineArg(string)
public static File NewForCommandlineArg(string arg)
Parameters
argstring
Returns
NewForCommandlineArgAndCwd(string, string)
[Version("2.36")]
public static File NewForCommandlineArgAndCwd(string arg, string cwd)
Parameters
Returns
NewForPath(string)
public static File NewForPath(string path)
Parameters
pathstring
Returns
NewForUri(string)
public static File NewForUri(string uri)
Parameters
uristring
Returns
NewFromPointer(nint, bool)
Creates a new managed FileHelper instance for a given pointer.
public static FileHelper NewFromPointer(nint ptr, bool ownsHandle)
Parameters
Returns
NewTmpDirFinish(AsyncResult)
[Version("2.74")]
public static File NewTmpDirFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
OpenReadwrite(Cancellable?)
[Version("2.22")]
public FileIOStream OpenReadwrite(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
OpenReadwriteFinish(AsyncResult)
[Version("2.22")]
public FileIOStream OpenReadwriteFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
ParseName(string)
public static File ParseName(string parseName)
Parameters
parseNamestring
Returns
PeekPath()
[Version("2.56")]
public string? PeekPath()
Returns
PollMountableFinish(AsyncResult)
[Version("2.22")]
public bool PollMountableFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
QueryDefaultHandler(Cancellable?)
public AppInfo QueryDefaultHandler(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
QueryDefaultHandlerFinish(AsyncResult)
[Version("2.60")]
public AppInfo QueryDefaultHandlerFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
QueryExists(Cancellable?)
public bool QueryExists(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
QueryFileType(FileQueryInfoFlags, Cancellable?)
[Version("2.18")]
public FileType QueryFileType(FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
flagsFileQueryInfoFlagscancellableCancellable
Returns
QueryFilesystemInfo(string, Cancellable?)
public FileInfo QueryFilesystemInfo(string attributes, Cancellable? cancellable)
Parameters
attributesstringcancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
QueryFilesystemInfoFinish(AsyncResult)
public FileInfo QueryFilesystemInfoFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
QueryInfo(string, FileQueryInfoFlags, Cancellable?)
public FileInfo QueryInfo(string attributes, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
attributesstringflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
QueryInfoFinish(AsyncResult)
public FileInfo QueryInfoFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
QuerySettableAttributes(Cancellable?)
public FileAttributeInfoList QuerySettableAttributes(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
QueryWritableNamespaces(Cancellable?)
public FileAttributeInfoList QueryWritableNamespaces(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
Read(Cancellable?)
public FileInputStream Read(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
ReadFinish(AsyncResult)
public FileInputStream ReadFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
Replace(string?, bool, FileCreateFlags, Cancellable?)
public FileOutputStream Replace(string? etag, bool makeBackup, FileCreateFlags flags, Cancellable? cancellable)
Parameters
etagstringmakeBackupboolflagsFileCreateFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
ReplaceContents(Span<byte>, string?, bool, FileCreateFlags, out string?, Cancellable?)
public bool ReplaceContents(Span<byte> contents, string? etag, bool makeBackup, FileCreateFlags flags, out string? newEtag, Cancellable? cancellable)
Parameters
contentsSpan<byte>etagstringmakeBackupboolflagsFileCreateFlagsnewEtagstringcancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
ReplaceContentsFinish(AsyncResult, out string?)
public bool ReplaceContentsFinish(AsyncResult res, out string? newEtag)
Parameters
resAsyncResultnewEtagstring
Returns
Exceptions
- GException
Throws a GException in case of an error.
ReplaceFinish(AsyncResult)
public FileOutputStream ReplaceFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
ReplaceReadwrite(string?, bool, FileCreateFlags, Cancellable?)
[Version("2.22")]
public FileIOStream ReplaceReadwrite(string? etag, bool makeBackup, FileCreateFlags flags, Cancellable? cancellable)
Parameters
etagstringmakeBackupboolflagsFileCreateFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
ReplaceReadwriteFinish(AsyncResult)
[Version("2.22")]
public FileIOStream ReplaceReadwriteFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
ResolveRelativePath(string)
public File ResolveRelativePath(string relativePath)
Parameters
relativePathstring
Returns
SetAttribute(string, FileAttributeType, nint, FileQueryInfoFlags, Cancellable?)
public bool SetAttribute(string attribute, FileAttributeType type, nint valueP, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
attributestringtypeFileAttributeTypevaluePnintflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
SetAttributeByteString(string, string, FileQueryInfoFlags, Cancellable?)
public bool SetAttributeByteString(string attribute, string value, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
attributestringvaluestringflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
SetAttributeInt32(string, int, FileQueryInfoFlags, Cancellable?)
public bool SetAttributeInt32(string attribute, int value, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
attributestringvalueintflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
SetAttributeInt64(string, long, FileQueryInfoFlags, Cancellable?)
public bool SetAttributeInt64(string attribute, long value, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
attributestringvaluelongflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
SetAttributeString(string, string, FileQueryInfoFlags, Cancellable?)
public bool SetAttributeString(string attribute, string value, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
attributestringvaluestringflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
SetAttributeUint32(string, uint, FileQueryInfoFlags, Cancellable?)
public bool SetAttributeUint32(string attribute, uint value, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
attributestringvalueuintflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
SetAttributeUint64(string, ulong, FileQueryInfoFlags, Cancellable?)
public bool SetAttributeUint64(string attribute, ulong value, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
attributestringvalueulongflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
SetAttributesFromInfo(FileInfo, FileQueryInfoFlags, Cancellable?)
public bool SetAttributesFromInfo(FileInfo info, FileQueryInfoFlags flags, Cancellable? cancellable)
Parameters
infoFileInfoflagsFileQueryInfoFlagscancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
SetDisplayName(string, Cancellable?)
public File SetDisplayName(string displayName, Cancellable? cancellable)
Parameters
displayNamestringcancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
SetDisplayNameFinish(AsyncResult)
public File SetDisplayNameFinish(AsyncResult res)
Parameters
resAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
StartMountableFinish(AsyncResult)
[Version("2.22")]
public bool StartMountableFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
StopMountableFinish(AsyncResult)
[Version("2.22")]
public bool StopMountableFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
SupportsThreadContexts()
[Version("2.22")]
public bool SupportsThreadContexts()
Returns
Trash(Cancellable?)
public bool Trash(Cancellable? cancellable)
Parameters
cancellableCancellable
Returns
Exceptions
- GException
Throws a GException in case of an error.
TrashFinish(AsyncResult)
[Version("2.38")]
public bool TrashFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
UnmountMountableFinish(AsyncResult)
public bool UnmountMountableFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.
UnmountMountableWithOperationFinish(AsyncResult)
[Version("2.22")]
public bool UnmountMountableWithOperationFinish(AsyncResult result)
Parameters
resultAsyncResult
Returns
Exceptions
- GException
Throws a GException in case of an error.