Moving upwards on a directory

Hi,

I need to move upwards on a directory 3 times. Is there a solution for this which is not hard coded like this way ?

thisProcess.nowExecutingPath.dirname.dirname.dirname

All the best,
Fellipe

You could always loop it, but I don’t see that this is much more convenient (but, convenient to wrap in a function).

var path = ...;
3.do {
    path = path.dirname;
}

(At least this way, the number 3 is more easily variable.)

Also, appending "/.." will go up a directory level (should double check Windows, though).

hjh

1 Like

There is also a .parentLevelPath(x) in the atk quarks directory

1 Like

Thanks, this will help a lot!