0

What is the chain of apps involved in process of opening a file from a file manager?

Consider these two moments, say it's Xfce 4 and a simple plain text file set up to open in Mousepad:

  1. I hit double-click the file in Thunar or Nautilus etc.,

  2. Mousepad is launched with the file

The background is that I have a bug which seems to happen even when I use different file manager as well as application. For example, Nautilus/Mousepad or Thunar/Libreoffice Calc scenarios suffer from this bug as well.

It's Debian Jessie amd64, FTM.

3
  • 1
    Could you clarify a little? What is this bug? What do you mean by using a "different app for A as well as Z"? Do you mean a bug when you double click in any file manager and open a file in the associated program? – terdon Nov 12 '13 at 23:54
  • @terdon Yes, I mean double-click in a FM. I have clarified the Q as well as removed the A and Z, thanks for feedback. – Alois Mahdal Nov 13 '13 at 0:44
  • For @terdon and other curious people, the bug: having utf8 as default, when you open a non-utf8 text file in Mousepad such that causes a Unicode error, MP opens a dialog asking you to select proper encoding. Now the bug is that not resolving (cancel / choose encoding) the dialog in ~30s, causes the same file be opened again, resulting in 2 such dialogs (but not 3, etc. by extended waiting---it stops at 2). I can't be sure it's MP since part of observed details happen with Calc as well. – Alois Mahdal Nov 13 '13 at 23:25
1

You can find out what's going on behind the scenes of an application by using the tool strace. Simply invoke the tool in question like so:

 $ strace <app>

Be warned there will be a lot of output generated by this tool so you'll likely want to dump it to a file.

 $ strace -o <logfile> <app>

Example

First collect the log.

$ strace -o trace.log thunar

Once it either crashes or you close it, you can review the logs. Here's a dump of what the log file looks like.

$ less trace.log
execve("/usr/bin/thunar", ["thunar"], [/* 93 vars */]) = 0
brk(0)                                  = 0x13aa000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7913726000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=243371, ...}) = 0
mmap(NULL, 243371, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f79136ea000
close(3)                                = 0
open("/usr/lib64/libX11.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \337\241\3514\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1308808, ...}) = 0
mmap(0x34e9a00000, 3403160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x34e9a00000
....

References

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.