Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在破解 Evince 并尝试添加一个在文件属性页面中显示文件大小的功能。
但我无法从 Nautilus 文件信息中获取文件大小值。
有人如何从 Nautilus 获取文件的大小信息吗?我可以使用ls -l和stat命令在终端中获取它。
假设 Evince 使用GIO(我找不到快速浏览其代码的方法),您可以使用 egg_file_query_info()来获取GFileInfo 指针。
g_file_query_info()
GFileInfo
然后您可以使用g_file_info_get_size()来获取文件的大小。
g_file_info_get_size()