First message out here on the group, and I hope you can help me out.
I am running a bunch of commands that can take a long time (10 seconds
minutes and beyond). Naturally, I decided to multithread them, which
them run a lot faster since I have a multi-core machine. The problem is
all access a log file in the current directory, and they collide.
So, my next step was to use Dir.chdir to move to another directory for
thread and run there. Now it works.
Now, my problem is that I have been using backticks (`) to run commands,
I would like to switch to popen in order to stifle the output (it spits
a lot of info that I don’t want all over my tests, and it generates odd
characters that mess up my terminal).
The problem is that popen doesn’t respect Dir.chdir. I have also tried
popen(“cd otherdir; command”)
popen(“cd otherdir && command”)
but it doesn’t seem to care at all, and always runs in rails root.
So I need one of two things:
- Change directory for popen
- Stifle stdout and stderr for