↧
Answer by Kaushal Modi for How to redirect output to file if no console...
It's a combination of using isatty() as suggested by genotrance and the code that you found :)# stdout_to_file.nim import terminal, strformat, timesif isatty(stdout): # ./stdout_to_file echo "This is...
View ArticleAnswer by Raymond Imber for How to redirect output to file if no console...
Edit:@tjohnson this is in response to your comment. I don't have enough points to respond to your comment directly or something? Thanks Stack Overflow...It's hard to say without seeing more of the...
View ArticleAnswer by genotrance for How to redirect output to file if no console...
You should be able to use isatty().Here's an example in Nimble.
View ArticleHow to redirect output to file if no console detected in Nim
I want my Nim program to write to the console if there is one, and redirect echo to write to a file if there isn't. Is there an equivalent to the Environment.UserInteractive property in .NET which I...
View Article