[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sun, 18 Feb 2007 15:10:41 +0100
Thunderbird 184.108.40.206 (Macintosh/20061207)
Vic Norton schrieb:
Can anyone tell me how to change the working directory to where you are?
For example it would be nice to have a "here" function that would return the
path of the directory in which a script resides. Then
thisdir = here();
would do just what I want.
I do this kind of thing all the time in Perl with the two lines
use FindBin qw($Bin);
I'd like to be able to do it in Octave.
Thanks for any suggestions you might have. - Vic
I think you are either looking for the 'pwd' function or the 'which' function. I
actually don't know what Perl gives you...
So 'pwd' returns the actual path you're in, but if the path isn't that your
functio is in, then you should better use which ('function') and function is
name of the function you're using.
Hope this is the one you're looking for,
- here?, Vic Norton, 2007/02/18
- Re: here?, David Bateman, 2007/02/18
- Re: here?, Søren Hauberg, 2007/02/18
- Re: here?,
Thomas Treichl <=
- Re: here?, Vic Norton, 2007/02/18