本文整理汇总了C#中GLib.QueryFileType方法的典型用法代码示例。如果您正苦于以下问题:C# GLib.QueryFileType方法的具体用法?C# GLib.QueryFileType怎么用?C# GLib.QueryFileType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLib
的用法示例。
在下文中一共展示了GLib.QueryFileType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
private void Delete (string directory, GLib.File dir, bool recursive)
{
if (!dir.Exists) {
Console.WriteLine ("{0} doesn't exist", directory);
return;
}
if ((dir.QueryFileType (FileQueryInfoFlags.None, null) & FileType.Directory) == 0) {
Console.WriteLine ("{0} isn't directory", directory);
return;
}
// If native, use the System.IO recursive delete
if (dir.IsNative && !DisableNativeOptimizations) {
System.IO.Directory.Delete (directory, recursive);
return;
}
if (recursive) {
foreach (string child in GetFiles (dir, false)) {
FileFactory.NewForUri (child).Delete ();
}
foreach (string child in GetDirectories (dir, false)) {
Delete (child, GetDir (child, true), true);
}
}
dir.Delete ();
}
示例2: Delete
private void Delete (string directory, GLib.File dir, bool recursive)
{
if (!dir.Exists) {
return;
}
if (dir.QueryFileType (FileQueryInfoFlags.NofollowSymlinks, null) != FileType.Directory) {
return;
}
// If native, use the System.IO recursive delete
if (dir.IsNative && !DisableNativeOptimizations) {
System.IO.Directory.Delete (directory, recursive);
return;
}
if (recursive) {
foreach (string child in GetFiles (dir, false)) {
FileFactory.NewForUri (child).Delete ();
}
foreach (string child in GetDirectories (dir, false)) {
Delete (child, GetDir (child, true), true);
}
}
dir.Delete ();
}