[Vala] Get CREATION DATE OR TIME of file



Best regards . Attempt to get the date or time unix date of creation
of a file and do not get it , I used the following code :


        var directory = File.new_for_path (path);

var fi = directory.query_info ("*", GLib.FileQueryInfoFlags.NONE);

 stdout.printf ("Date %s \n", fi.get_attribute_as_string
(GLib.FileAttribute.TIME_CREATED));
 stdout.printf ("Date or time %s \n", fi.get_attribute_int64
(GLib.FileAttribute.TIME_MODIFIED).to_string());

I always returns 0 , maybe I'm not doing it correctly , be obliged his help.

I'm using Windows valac - 0.26 .


Mis proyectos de software libre en:
Github - edwinspire


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