Não, não basta fazer chamadas para cp
, mv
, etc.
Em vez disso, faz chamadas para uma biblioteca GTK + que contém funções de wrapper em torno das bibliotecas do sistema C / C ++ que também contêm funções. São essas funções C / C ++ que são compartilhadas no Nautilus e comandos como cp
, mv
, etc.
Exemplo
Você pode usar a ferramenta de rastreamento do sistema strace
para anexar a um processo nautilus
em execução da seguinte forma:
$ strace -Ff -tt -p $(pgrep nautilus) 2>&1 | tee strace-naut.log
Agora, se executarmos algumas operações no Nautilus, veremos as chamadas do sistema que estão sendo feitas. Aqui está uma amostra dos logs durante a cópia / colagem do arquivo /home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz
.
[pid 25897] 22:28:36.909183 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 25897] 22:28:36.909259 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", R_OK) = 0
[pid 25897] 22:28:36.909302 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", W_OK) = 0
[pid 25897] 22:28:36.909339 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", X_OK) = -1 EACCES (Permission denied)
[pid 25897] 22:28:37.580109 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 25897] 22:28:37.580169 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", R_OK) = 0
[pid 25897] 22:28:37.580215 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", W_OK) = 0
[pid 25897] 22:28:37.580249 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", X_OK) = -1 EACCES (Permission denied)
[pid 26667] 22:28:39.222446 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.222981 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.223201 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.223304 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.223397 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.223444 open("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", O_RDONLY) = 46
[pid 26667] 22:28:39.223658 open("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", O_WRONLY|O_CREAT|O_EXCL, 0664) = 47
[pid 25897] 22:28:39.235249 read(14, "\f$ strace -Ff -tt -p $(pgrep nautilus) 2>&1 | tee strace-naut.log
[pid 25897] 22:28:36.909183 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 25897] 22:28:36.909259 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", R_OK) = 0
[pid 25897] 22:28:36.909302 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", W_OK) = 0
[pid 25897] 22:28:36.909339 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", X_OK) = -1 EACCES (Permission denied)
[pid 25897] 22:28:37.580109 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 25897] 22:28:37.580169 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", R_OK) = 0
[pid 25897] 22:28:37.580215 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", W_OK) = 0
[pid 25897] 22:28:37.580249 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", X_OK) = -1 EACCES (Permission denied)
[pid 26667] 22:28:39.222446 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.222981 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.223201 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.223304 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.223397 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", {st_mode=S_IFREG|0664, st_size=16090900, ...}) = 0
[pid 26667] 22:28:39.223444 open("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06.tar.gz", O_RDONLY) = 46
[pid 26667] 22:28:39.223658 open("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", O_WRONLY|O_CREAT|O_EXCL, 0664) = 47
[pid 25897] 22:28:39.235249 read(14, "\f%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%00%pre%%pre%%pre%ULD_Linux_V1.00."..., 1024) = 96
[pid 26667] 22:28:39.388744 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", <unfinished ...>
[pid 26667] 22:28:39.388853 chmod("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", 0100664 <unfinished ...>
[pid 26667] 22:28:39.388959 stat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", <unfinished ...>
[pid 26667] 22:28:39.389061 utimes("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", {{1388460519, 222672}, {1384901700, 0}} <unfinished ...>
[pid 26667] 22:28:39.391274 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", <unfinished ...>
[pid 26667] 22:28:39.391848 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", R_OK <unfinished ...>
[pid 26667] 22:28:39.391955 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", W_OK <unfinished ...>
[pid 26667] 22:28:39.392059 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", X_OK <unfinished ...>
[pid 26667] 22:28:39.392734 lgetxattr("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", "security.selinux" <unfinished ...>
%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%00%pre%%pre%%pre%ULD_Linux_V1.00."..., 1024) = 96
[pid 26667] 22:28:39.388744 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", <unfinished ...>
[pid 26667] 22:28:39.388853 chmod("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", 0100664 <unfinished ...>
[pid 26667] 22:28:39.388959 stat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", <unfinished ...>
[pid 26667] 22:28:39.389061 utimes("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", {{1388460519, 222672}, {1384901700, 0}} <unfinished ...>
[pid 26667] 22:28:39.391274 lstat("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", <unfinished ...>
[pid 26667] 22:28:39.391848 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", R_OK <unfinished ...>
[pid 26667] 22:28:39.391955 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", W_OK <unfinished ...>
[pid 26667] 22:28:39.392059 access("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", X_OK <unfinished ...>
[pid 26667] 22:28:39.392734 lgetxattr("/home/saml/samsung_ml2165w_print_drivers/ULD_Linux_V1.00.06 (copy).tar.gz", "security.selinux" <unfinished ...>
As chamadas do sistema, lstat
, access
, open
, read
, etc. são as chamadas de nível inferior que seriam comuns.