home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!Germany.EU.net!ernohb!ernohb.UUCP!token
- From: token@ernohb.UUCP (thomas kendelbacher)
- Newsgroups: comp.lang.smalltalk
- Subject: Re: command line arguments
- Message-ID: <2087@ernohb.UUCP>
- Date: 21 Dec 92 11:54:42 GMT
- References: <667@funsys.funsys.se> <1992Dec18.213909.18271@sol.ctr.columbia.edu>
- Sender: news@ernohb.UUCP
- Organization: Erno Raumfahrttechnik GmbH, Bremen, Germany
- Lines: 43
- Nntp-Posting-Host: csf_9
-
- In article <1992Dec18.213909.18271@sol.ctr.columbia.edu>, mchan@deacon (Samuel R. McHan) writes:
- |> Jan Gifvars (jgs@funsys.se) wrote:
- |> : Is it possible to retreive command line arguments in my smalltalk image ?
- |> : For example :
- |> :
- |> : $ st80 myImage.im textFile.doc
- |> :
- |> : I just want to parse the commandline.
- |> :
- |> : [...]
- |> :
- |>
- |> In the past, I've used a program which would take the command line
- |> arguments, stuff them into a file, and then start my image. The image
- |> would then look for the existance of the file and copy the contents from
- |> it. A kludge, I know, but I didn't know how to read the command line
- |> any other way. Ideas?
-
- Just another kludge: Use a programming language other than C (but with
- access to C routines), where the "main" procedure is not identified
- by the symbol "_main". Link it with the "st80.o" provided for VMs
- with user defined primitives (this, since it is written in C, **does**
- provide an entry point "_main" -- look into the symbol table.)
-
- Use the main program body to analyse the command line arguments,
- store them so that Smalltalk will later be able to access them via
- User Defined Primitives (which you must provide, too, of course),
- then call the Smalltalk VM by calling the C function "main" with
- call parameters appropriate for the Smalltalk VM.
-
- I once tried this on a Sun-3 with Ada, and it worked just fine.
- Smalltalk was Objectworks V2.5 (sorry, no newer experience).
-
- One caveat: If using Ada, avoid tasks, since the Smalltalk VM and
- the Ada runtime system will compete for some UNIX signals
- (e.g. SIGALRM, maybe others, too). Should be a lesser problem
- with languages with a less "embracing" runtime system.
-
- Have fun.
- Thomas Kendelbacher | email : tkendel@ernohb.uucp
- Robbenplate 13 | voice : +49 421 539 5492
- D-2800 Bremen 66 | or : +49 421 57 04 37
- Germany
-