如果可能的话,如何跟踪可执行文件中的所有输出文件?:
我被分配到一个没有文档和大量非托管代码的项目。 整个项目中有明确声明的路径(事实上,它们是在不同位置设置为不同值的环境变量)指向输出文件。我已更改这些以将输出重定向到工作区中的目录,但文件尚未生成,也无法在工作区中找到它们。我相信它们是在文件系统的其他地方创建的。正如我之前提到的,有很多不同的地方可以通过使用脚本来分配环境变量。我以为我已经得到了相关的脚本,但显然我遗漏了一些东西。
是否有一个实用程序可以用来跟踪特定可执行文件的所有文件输出(打印出所有读/写的文件名)?
我在 Fedora 下工作,该项目主要是用 Fortran 编写的。
I have been assigned to a project with no documentation and lots of unmanaged code.
There are explicitly-declared paths throughout the project (and in fact, they are environmental variables that were being set to different values in different places) that point to output files. I've changed these to redirect the output to directories in my workspace, but yet the files are not produced, nor can I find them in my workspace. I believe they're being created somewhere else in the filesystem. As I mentioned before, there are many different places that the environmental variables are assigned, through the use of scripts. I thought I had gotten the relevant scripts, but apparently I am missing something.
Is there a utility I can use to track all file output from a particular executable (print out all file names read/written)?
I am working under Fedora and the project is written primarily in Fortran.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
strace 将打印每个系统调用的详细信息,您可以简单地过滤输出以查找对 open() 的调用。
strace will print details for every syscall, you can simply filter the output for calls to open().
一种选择是 lsof 例如
One option is
lsof
e.g.