Matthew John <mj / mjcltd.net> wrote:
> I've written a little script to test, and it looks like the
> second reply by Mike is the only one that works.  The other
> two provide me with the location of the file, not the
> directory where the file was run from.

Excellent!  I love seeing posters get resourceful with the
answers they receive!  This makes me happy.  :)

Yes, File.dirname and Dir.getwd do two very different things,
which you discovered.  There seems to have been a small
misunderstanding.

File.dirname simply does string manipulation on its argument,
whereas Dir.getwd actually gets the directory from which the
current script ($0) was invoked... which is what you were asking
for.

BTW, $0 and $PROGRAM_NAME are aliases for the same variable.

> Thanks for your help.

Thank you for making the most of the help offered!

Cheers!
Tim Hammerquist