• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: specifying the source of stdin (pipe / file)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: specifying the source of stdin (pipe / file)


  • Subject: Re: specifying the source of stdin (pipe / file)
  • From: Rick Sustek <email@hidden>
  • Date: Fri, 2 May 2008 09:21:30 -0700

Not clear on what you are after.

Do you mean you want to launch your utility from within Xcode and have Xcode feed a command line to it?

or

Do you mean that you want to launch your utility on a shell command line, and redirect a file into the stdin of your program?
like:
% cat fooFile | myUtil
or
% myUtil < fooFile




-Rick




Begin forwarded message:
From: Adam Richard <email@hidden>
Date: May 2, 2008 6:17:54 AM PDT
To: email@hidden
Subject: specifying the source of stdin (pipe / file)

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[/CODE]

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?

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: specifying the source of stdin (pipe / file)
      • From: Adam Richard <email@hidden>
References: 
 >specifying the source of stdin (pipe / file) (From: Adam Richard <email@hidden>)

  • Prev by Date: Re: Creating Apple based forms based on MS Windows forms.
  • Next by Date: Re: specifying the source of stdin (pipe / file)
  • Previous by thread: specifying the source of stdin (pipe / file)
  • Next by thread: Re: specifying the source of stdin (pipe / file)
  • Index(es):
    • Date
    • Thread