作为项目的一部分,Mono 程序必须将一系列图像写入电影。因此,图像首先被缓存在/tmp/
文件夹/中,因为它们有可能是前一个会话的静止图像。我想删除这些图像。因此我使用以下命令:
Process proc = new Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "rm";
proc.StartInfo.Arguments = "/tmp/output*";
proc.Start();
proc.WaitForExit();
但是,当程序执行时,我收到以下警告:/bin/rm: cannot remove '/tmp/output*': No such file or directory.
.
但是,当我/bin/rm /tmp/output*
在终端中(在用户模式下)执行时,该命令在识别文件时似乎没有问题。
为什么这个命令不起作用?