View Single Post
  #1  
Old May 1st, 2008, 03:37 PM
g4c9z g4c9z is offline
Registered User
 
Join Date: May 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
g4c9z is on a distinguished road
XCode help - specifying the source of stdin

I am trying to write a command-line application with XCode.

My application takes input from stdin. The way I normally use it is to use redirection to specify the input file. For example:

Code:
program < input.txt
In XCode, this is presumably specified by creating an executable and editing its info, via Project -> Edit Active Executable "...".

But the dialog doesn't explain how to specify where input comes from. Changing the arguments to include "< input.txt" doesn't work, I guess because "<" is a symbol known to the Terminal, and XCode probably bypasses the Terminal. Changing the option to "Use Pipe for standard input/output" seems to have no effect - perhaps there's a way to specify a pipe, but the dialog won't let me. Searching the XCode User's Guide didn't explain it either - it mentions the "Use Pipe" option, but doesn't describe how it works.

How can I get standard input from a file?
Reply With Quote