home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.atari.st.tech
- Path: sparky!uunet!usc!sdd.hp.com!ux1.cso.uiuc.edu!news.iastate.edu!vincent1.iastate.edu!sourada
- From: sourada@iastate.edu (Steven D Ourada)
- Subject: Re: Problems with ARGV
- Message-ID: <sourada.712465676@vincent1.iastate.edu>
- Sender: news@news.iastate.edu (USENET News System)
- Organization: Iowa State University, Ames IA
- References: <9130026@hpbbrd.bbn.hp.com> <92211.111512RESCHKE@DMSWWU1A.UNI-MUENSTER.DE> <1992Jul29.130755.27902@mks.com> <1992Jul29.221225.24054@mnemosyne.cs.du.edu>
- Date: Thu, 30 Jul 1992 03:07:56 GMT
- Lines: 40
-
- In <1992Jul29.221225.24054@mnemosyne.cs.du.edu> ilepore@nyx.cs.du.edu (Ian Lepore) writes:
-
- > > ARGV doesn't allow passing empty arguments
- > > use another env var to pass the position of the empty args
- >
- > I don't like it. It sounds needlessly complicated to create a whole
- >'nother env var for this.
-
- I agree on that point.
-
- > I have two variations on an idea for coping with this. The first variation
- >assumes that we never pass binary values in the ARGV. (IE, isprint() is
- >TRUE for all chars appearing in the args in the ARGV area.) In this case,
- >I'd recommend using \001 as a placeholder for an empty arg. Using this,
- >
- > grep "" *.c
-
- > would be passed as ARGV=\0grep\0\1\0*.c\0\0. If my assumption is invalid,
- >and folks do pass binary data in ARGV, then use an escape system where an
- >empty arg is \1\1, but a true binary 1 is \1\2. (You could even extend
- >this to allow passing binary zeros, escaped as \1\3 for example.)
-
- I was thinking something along these lines, also. What I was thinking about
- was using a single space to signify an empty argument. Then, for arguments
- that consist of spaces (fairly rare, I'd think), a space is added to the
- string. A program using this convention (or compiled with a runtime that
- handled it) would subtract a space off any argument that consisted of
- only spaces.
-
- The question is, of the schemes mentioned so far (or related ones), which
- would break the least of the existing ARGV programs? (I vote for mine :-))
-
- Later,
- Steven Ourada
-
- --
- -----------------
- Steven Ourada Member of the Students for Electronic Freedom
- Ask me how Iowa State University is censoring my Usenet access!
- sourada@iastate.edu "can't casts no shadow" -- cummings
-