Improve this question. Jaguar Jaguar 33 2 2 silver badges 6 6 bronze badges. Checking and deleting the file programmatically. Two lines is a hardship? Add a comment. Active Oldest Votes. Improve this answer. Sean Sean Only works with PerlIO - that is, stuff inside Perl. Not sure if the question is for perl-only, or for sub-processes, too - not entirely clear :- — Tanktalus.
If PerlIO is all that's wanted, an in memory file could be used. The OP specifically said "without resorting to checking and deleting the file manually" - which is basically what you're doing? Tanktalus - A manual process is one which is not automated. Checking and deleting manually would be: run process; ls -l logfile; rm logfile. To get in touch, send an email to perl. The information published on this website may not be suitable for every situation.
All work on this website is provided with the understanding that Perl. Neither Perl. Terminal redirects Before you launch your favourite text editor and start hacking Perl code, you may just need to redirect the program output in the terminal. David Farrell David is a professional programmer who regularly tweets and blogs about code and the art of programming. Be sure to take a look there when you're debugging problems. You could do this with a tied file handle too, as demonstrated recently by tilly - here.
An answer that uses fork. Sometimes it's easier to let the shell work for you. Other commands, such as strace or dialog provide means to redirect stderr. There is also an option for writing a textfile for each subprocess that strace sees. There's also the method of named pipes. I recommend reading the linked post about the dialog command for thorough description of what's happening.
Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. How to redirect stderr to a file [duplicate] Ask Question. Asked 6 years, 8 months ago. Active 2 years, 2 months ago. Viewed 1. Improve this question.
0コメント