From: Fred Phillips Date: 2008-10-28T04:20:43+09:00 Subject: Re: How to find directory of currently running .rb file --AhhlLboLdkugWU4S Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon Oct 27 19:01:04 2008, Kenneth McDonald wrote: > __FILE__ is just giving me the file name, with no path, and Dir.getwd is= =20 > giving me an error: "ENOENT: No such file or directory." What is the prop= er=20 > way to get this info? __FILE__ gives you the path it was called with, if your Ruby script is in the current working directory it will return =E2=80=9C./foo.rb=E2=80=9D = if it is in /usr/local/bin __FILE__ will be =E2=80=9C/usr/local/bin/foo.rb=E2=80=9D. If= you want the full path instead of =E2=80=9C./=E2=80=9D Dir.getwd should work. --=20 Fred O. Phillips http://fophillips.org BBC7 7572 755F 83E0 3209 504A E4F7 874F 1545 9D41 --AhhlLboLdkugWU4S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkkGFJwACgkQ5PeHTxVFnUFtIwCfbem5TE/BO0VLBS+bKxoX2eSo tgEAniYr3+gpj3iAXQcb/4jJzS7N91m6 =DtQR -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--