delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/06/16:47:34

From: Fred Smith <fredex AT fcshome DOT stoneham DOT ma DOT us>
Message-Id: <199707061658.MAA00847@fcshome.stoneham.ma.us>
Subject: Re: stubify/stubedit
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Sun, 6 Jul 1997 12:58:27 -0400 (EDT)
Cc: djgpp AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.970706173234.8624H-100000@is> from "Eli Zaretskii" at Jul 6, 97 05:32:55 pm

Thinking furiously, Eli Zaretskii wrote:
> On Fri, 4 Jul 1997, Fred Smith wrote:
> > I would like to create a "link" using stubify/stubedit which passes
> > certain parameters to the linked-to program in addition to the argv[0]
> > which it now supports. There does not at this time appear to be any way
> > to do that.
> > 
> > Would/could the gurus who understand those programs give me a hint
> > as to whether it is even feasible, were I to undertake to do it myself?
> 
> You are talking about alias, not a symlink.  A symlink is just a
> pointer to another file, it doesn't change anything about the
> parameters passed to the program that gets invoked.  DJGPP only lets
> you specify the value of argv[0] that will be passed to the program.

Yes, I understand symlinks (being a Unix person). I was hoping for a
way (but not EXPECTING! a way) to subvert the link kludge in DJGPP
for my purposes.

> I don't think you can easily change this, since it requres numerous
> patches in the stub, the stubinfo structure and the library functions
> that invoke child programs.
> 
> It's better to use an alias facility, or create a batch file.
> Alternatively, write a small helper program that will add the
> additional parameters and invoke the other program.

I can easily write a little program to exec the one I want, but was
wondering if the fake symlink hack could be made to do it. 

The reason I wanted it was because I specifically wanted to invoke ls
with some non-default options; if I make a batch file for it I cannot
redirect the batch file's output, when I wish, into less or to a file
since DOS is brain-damaged in that regard.

I plan to try the DJGPP port of BASH, soon, which will probably solve the
batchfile problem, but given that this is at work don't have a lot of
time for playing.

Thanks for the reply!

Fred
-- 
-------------------------------------------------------------------------------
 .----    Fred Smith    /                        Office: fred AT computrition DOT com 
( /__  ,__.   __   __ /  __   : /                                 508-663-2524 
 /    /  /   /__) /  /  /__) .+'           Home: fredex AT fcshome DOT stoneham DOT ma DOT us 
/    /  (__ (___ (__(_ (___ / :__                                 617-438-5471 
-------------------------------- Jude 1:24,25 ---------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019