File: TestInfo.cs

package info (click to toggle)
gtk-sharp2 2.8.3-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 21,208 kB
  • ctags: 5,843
  • sloc: xml: 245,420; cs: 24,183; sh: 8,547; ansic: 2,739; makefile: 1,582; perl: 1,177
file content (27 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using Gnome.Vfs;
using System;
using System.Text;

namespace TestGnomeVfs {
	public class TestInfo {
		static void Main (string[] args)
		{
			if (args.Length != 1) {
				Console.WriteLine ("Usage: TestInfo <uri>");
				return;
			}
		
			Gnome.Vfs.Vfs.Initialize ();

			Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]);
			
			FileInfoOptions options = FileInfoOptions.GetMimeType |
						  FileInfoOptions.FollowLinks |
						  FileInfoOptions.GetAccessRights;
			FileInfo info = uri.GetFileInfo (options);
			Console.WriteLine (info.ToString ());
			
			Gnome.Vfs.Vfs.Shutdown ();
		}
	}
}