Re: [Vala] How to get date/time infos from a file ?



On Mi, 2013-08-21 at 14:41 +0200, raum no-log org wrote:
Hello,

I'm trying to get informations like TIME_ACCESS, TIME_CREATED, ... from a
file but I don't know how.

For example :
   var file = File.new_for_path ("some_file.txt");

You have to add things you want to extract from the FileInfo on the line
below also in the line here (or use "*" to get everything).

   var file_info = file.query_info (FILE_ATTRIBUTE_STANDARD_NAME + "," +
FILE_ATTRIBUTE_STANDARD_TYPE, 0);
   int64 file_stamp =
file_info.get_attribute_int64(FileAttribute.TIME_ACCESS);

   stdout.printf ("%" + int64.FORMAT + "\n", file_stamp);




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