win32 进程在 CreateProcess 上冻结字符串?
我尝试使用 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
我在这里错过了什么吗?
I tried using Process.create to start a sub process to execute a batch file in a particular directory. This is what I did:
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")
The execution failed as:
(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
Did I miss something here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 dup 创建冻结字符串的未冻结副本。
您知道 Win32 Process 的 RDoc 在哪里吗?
You can create an unfrozen copy of a frozen string using
dup
.Do you happen to know where the RDoc for Win32 Process is?