0

I am hacking on Evince and trying to add a feature that shows the size of the file in the file-property page.

But I am unable to get the file-size value from Nautilus file info.

Does anybody how to get size-info of a file from Nautilus? I can get it in terminal using ls -l and stat commands.

goelakash
  • 2,502
  • 4
  • 40
  • 56
  • If you *can* get a fully specified file name, then you can use [`stat`](http://pubs.opengroup.org/onlinepubs/009695399/functions/stat.html) in your own code. – Jongware Dec 31 '14 at 11:56

1 Answers1

1

Assuming Evince uses GIO (I failed to find a way to quickly browse its code), you can use e.g. g_file_query_info() to get a GFileInfo pointer.

You can then use g_file_info_get_size() to get the size of the file.

unwind
  • 391,730
  • 64
  • 469
  • 606