[fpc-pascal]RE: Read from command line

Jeff Pohlmeyer yetanothergeek at yahoo.com
Mon Sep 8 18:32:40 CEST 2003

There is a subtle difference between ParamStr(0) and argv[0]:

  argv[0] is the verbatim command passed to the shell.
  ParamStr(0) is the full path to the executable.

Neither of these will dereference a symlink, to do that you
can call ReadLink recursively, or ReadLink(/proc/<PID>/exe)

Also note that the argv's are zero-based pchar's,
the paramstr's are one-based pascal strings.

The argv's are also writeable:

 This works:

 But this doesn't:

Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

More information about the fpc-pascal mailing list