Я пишу работу, и я должен подтвердить что-то, что довольно очевидно для меня, но я не видел код, который авторитетно сказал бы мне, что это - то, как он работает.
То, когда я открываю папку в Наутилусе, делает он звонит stat
syscall и file
команда на каждом регулярном файле в той папке? Я также задаюсь вопросом, как это генерирует миниатюры, но это - поиски стороны.
Наутилус записан в C. Я не нашел ссылки на stat
syscall в исходном коде, так не может сказать с 100%-й уверенностью, что это делает или не использует его.
тип Пантомимы файлов получен через nautilus_file_get_mime_type
функция, на которую ссылаются много в нескольких файлах такой как nautilus-mime-actions.c
, nautilus-properties-window.c
, nautilus-window-slots.c
и другие.
Однако я не мог найти определение той функции, только присвоения:
$ grep -iR 'file_get_mime_type'
nautilus-canvas-view-container.c: mime_type = nautilus_file_get_mime_type (file);
nautilus-mime-actions.c: mime_type = nautilus_file_get_mime_type (file);
nautilus-mime-actions.c: mime_type_a = nautilus_file_get_mime_type (file_a);
nautilus-mime-actions.c: mime_type_b = nautilus_file_get_mime_type (file_b);
nautilus-mime-actions.c: mime_type = nautilus_file_get_mime_type (file);
nautilus-mime-actions.c: char *mime_type = nautilus_file_get_mime_type (parameters->file);
nautilus-mime-actions.c: mime_type = nautilus_file_get_mime_type (parameters_install->file);
nautilus-mime-actions.c: mime_type = nautilus_file_get_mime_type (parameters_install->file);
nautilus-mime-actions.c: mime_type = nautilus_file_get_mime_type (file);
nautilus-properties-window.c: ret = g_list_append (ret, nautilus_file_get_mime_type (NAUTILUS_FILE (l->data)));
nautilus-properties-window.c: mime_type = nautilus_file_get_mime_type (file);
nautilus-properties-window.c: mime_type = nautilus_file_get_mime_type (target_file);
nautilus-window-slot.c: mimetype = nautilus_file_get_mime_type (file);