search for: source_dirnam

Displaying 1 result from an estimated 1 matches for "source_dirnam".

Did you mean: source_dirname
2010 Jun 11
4
setting the current working directory to the location of the source file
...about it's own location. I need this to make sure that the script will find its datafiles after I move the whole directory. (The datafiles are in the same directory.) Here is a hack I invented to work around it: print(getwd()) source_pathname = get("ofile",envir = parent.frame()) source_dirname = dirname(source_pathname ) setwd(source_dirname) print(getwd()) Question: Is there a better, cleaner way? Thanks, mrgomel [[alternative HTML version deleted]]