I know that lsof
can list all files which are being opened by running processes.
If there is a process, which will open a file and then will be terminated, I don't think I can catch the file that is opened by the process with lsof
because the process terminated itself too fast.
So I'm looking for such a tool (named XXX
), allowing me to do the thing as below:
XXX ./my_process args
And the output of the command should be like this:
file1
file2
file3
Which means that the my_process
opens three files: file1
, file2
and file3
while running.
trace=open,creat,openat,openat2,name_to_handle_at
instead. (these are most of the system calls I could find which can open a file, I skipped the pcap ones) If it gives an error "invalid system call", remove that call from the list and try again. – Black Mantha Jul 06 '22 at 11:09