win32-process在CreateProcess上冻结了字符串?

时间:2011-03-24 01:18:40

标签: ruby windows win32-process

我尝试使用Process.create启动子进程以在特定目录中执行批处理文件。这就是我所做的:

proc_info = Process.create(  
:app_name => ENV['SystemRoot'] + "\\system32\\cmd.exe",  
:command_line => "C:\\some_bin\\some_cmd.bat some_parameter",  
:cwd => "C:\\some_workspace")

执行失败为:

(eval):3:in 'call': can't modify frozen string (TypeError)  
from (eval):3:in 'CreateProcess'  
from C:/Ruby187/lib/ruby/gems/1.8/gems/win32-process-0.6.5/lib/win32/pro
cess.rb:873:in 'create'  
from some_process_script.rb:11

我在这里错过了什么吗?

1 个答案:

答案 0 :(得分:0)

您可以使用dup创建冻结字符串的未冻结副本。

您是否碰巧知道Win32进程的RDoc在哪里?