gnome-vfs-sharp[00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 71 EB 6C 55 75 52 9C BF 72 44 F7 A6 EA 05 62 84 F9 EA E0 3B CF F2 CC 13 2C 9C 49 0A B3 09 EA B0 B5 6B CE 44 9D F5 03 D9 C0 A8 1E 52 05 85 CD BE 70 E2 FB 90 43 4B AC 04 FA 62 22 A8 00 98 B7 A1 A7 B3 AF 99 1A 41 23 24 BB 43 25 F6 B8 65 BB 64 EB F6 D1 C2 06 D5 73 2D DF BC 70 A7 38 9E E5 3E 0C 24 6E 32 79 74 1A D0 05 03 E4 98 42 E1 9B F3 7B 19 8B 40 21 26 CB 36 89 C2 EA 64 96 A4 7C B4]2.16.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.Basic directory operations: creating, reading and removing directories.
using GLib;
using Gnome.Vfs;
using System;
using System.Text;
namespace Test.Gnome.Vfs {
public class TestInfo {
private static MainLoop loop;
static void Main (string[] args)
{
if (args.Length != 1) {
Console.WriteLine ("Usage: TestDirectory <uri>");
return;
}
Gnome.Vfs.Vfs.Initialize ();
FileInfo[] entries = Gnome.Vfs.Directory.GetEntries (args[0]);
Console.WriteLine ("Directory {0} contains {1} entries:", args[0], entries.Length);
foreach (FileInfo info in entries) {
Console.WriteLine (info.Name);
}
Gnome.Vfs.Directory.GetEntries (args[0], FileInfoOptions.Default,
20, (int)Gnome.Vfs.Async.Priority.Default,
new AsyncDirectoryLoadCallback (OnDirectoryLoad));
loop = new MainLoop ();
loop.Run ();
Gnome.Vfs.Vfs.Shutdown ();
}
private static void OnDirectoryLoad (Result result, FileInfo[] entries, uint entries_read)
{
Console.WriteLine ("DirectoryLoad: {0}", result);
if (result != Result.Ok && result != Result.ErrorEof) {
loop.Quit ();
return;
}
Console.WriteLine ("read {0} entries", entries_read);
foreach (FileInfo info in entries) {
Console.WriteLine (info.Name);
}
if (result == Result.ErrorEof)
loop.Quit ();
}
}
}
System.ObjectMethodGnome.Vfs.FileInfo[]Load a directory from .
a a containing the files in the directory.To be addedMethodGnome.Vfs.FileInfo[]Load a directory from with the specified .
a for loading the directory.
a containing the files in the directory.To be addedMethodGnome.Vfs.FileInfo[]Load a directory from uri. representing the URI of the directory to be loaded.
a containing the files in the directory.To be addedMethodGnome.Vfs.FileInfo[]Load a directory from uri with the specified . representing the URI of the directory to be loaded.
for loading the directory.
a containing the files in the directory.To be addedMethodSystem.VoidAsynchronously load a directory from with the specified .
a for loading the directory.
the number of entries to read in the directory per notification.
a value from to (normally should be ) indicating the priority to assign this job in allocating threads from the thread pool.
a to be called when the specified number of entries have been read or the operation is complete.
To be addedMethodSystem.VoidAsynchronously load a directory from uri with the specified . representing the URI of the directory to be loaded.
for loading the directory.
the number of entries to read in the directory per notification.
a value from to (normally should be ) indicating the priority to assign this job in allocating threads from the thread pool.
a to be called when the specified number of entries have been read or the operation is complete.
To be addedMethodGnome.Vfs.ResultDelete . must be an empty directory. of the directory to be removed.
a To be addedMethodGnome.Vfs.ResultRemove uri. Uri must be an empty directory.
URI of the directory to be removed.
a To be addedMethodGnome.Vfs.ResultCreate a directory at . Only succeeds if a file or directory does not already exist at . of the directory to be created.
Unix-style permissions for the newly created directory.
a To be addedMethodGnome.Vfs.ResultCreate a directory at uri. Only succeeds if a file or directory does not already exist at the uri.
URI of the directory to be created.
Unix-style permissions for the newly created directory.
a To be added