Re: [Vala] [vala][newbie] file_info.get_file_type



On Mon, 2011-04-11 at 22:49 -0700, Charles Hixson wrote:
I   can't   figure   out   what   I'm   doing   wrong,   but      
file_info.get_file_type   always   returns   a   value   of   0   
(i.e.,   UNKNOWN):

That's correct, because…



// valac --pkg gio-2.0 walker.vala
// ./walker

void  walk (File directory)
{
    try
    {  var enumerator = directory.enumerate_children 
(FILE_ATTRIBUTE_STANDARD_NAME, 0);

… you don't query for it. Change to FILE_ATTRIBUTE_STANDARD_NAME + "," +
FILE_ATTRIBUTE_STANDARD_TYPE to also get the type.

See http://developer.gnome.org/gio/stable/GFileInfo.html#GFileInfo for
all flags (just remove the G_ prefix) for the vala version.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]