单声道的Process.Start如何找到的bash?

编程入门 行业动态 更新时间:2024-10-26 00:31:29
本文介绍了单声道的Process.Start如何找到的bash?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的webapp我做的下面。我知道它的正确的,因为我倾倒start_sz到一个文本文件试过1)2)苏www数据3)复制/粘贴提取字符串,它的工作。

In my webapp i do the below. I know its correct because i tried 1) dumping start_sz to a text file 2) su www-data 3) copy/paste the extract string and it worked.

var start_sz = string.Format(@"bash -c 'ln ""{2}/{0}"" ""{2}/{1}""'", fn, newfn, System.IO.Directory.GetCurrentDirectory()); Process.Start(start_sz);

我得到的异常的下方,与推理之上,我相信它说的bash无法找到。

I get the exception below so with reasoning above i believe its saying bash cannot be found.

找不到指定文件

在System.Diagnostics.Process.Start_shell(系统。 Diagnostics.ProcessStartInfo StartInfo的,过程的System.Diagnostics.Process)[0x00000]在0

at System.Diagnostics.Process.Start_shell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in :0

在System.Diagnostics.Process.Start_common(System.Diagnostics.ProcessStartInfo StartInfo的,系统.Diagnostics.Process程序)[0x00000]在0

at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in :0

在System.Diagnostics.Process.Start(System.Diagnostics.ProcessStartInfo的StartInfo)[0x00000]中:0

at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x00000] in :0

在System.Diagnostics.Process.Start(System.String文件名)[0x00000]在0

at System.Diagnostics.Process.Start (System.String fileName) [0x00000] in :0

在MySite.QueueManager.MakeLink(System.String FN)[0x00000]在0

at MySite.QueueManager.MakeLink (System.String fn) [0x00000] in :0

在MySite.QueueManager.ImageQueue2()[0x00000]在0

at MySite.QueueManager.ImageQueue2 () [0x00000] in :0

在MySite.QueueManager.ImageQueue()[0x00000]在0

at MySite.QueueManager.ImageQueue () [0x00000] in :0

所以,我该如何解决这一问题?基本上,我需要建立一个硬连接(软是确定太)在我的asp应用程序运行时间。

So, how do i fix this? basically i need to create a hardlink (soft is ok too) at run time in my asp app.

我想也许我需要完整的bash路径所以我尝试然而/斌/ bash的-c 这也不能工作。

I thought maybe i need the full bash path so i tried /bin/bash -c however that didn't work either.

推荐答案

为什么不叫 LN 直接?如果没有庆典?

Why not call ln directly? Without bash?

Process.Start("ln", params);

此外,你可能需要指定的完整路径:

Also you may need to specify the full path:

Process.Start("/bin/ln", params);


其实,的Process.Start(庆典)对我的作品,从而检查 $ PATH 环境变量等。


In fact, Process.Start("bash") works for me, thus check $PATH environment variable, etc.

更多推荐

单声道的Process.Start如何找到的bash?

本文发布于:2023-11-10 10:02:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1575074.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单声道   Process   bash   Start

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!