From: GianFranco Bozzetti Date: 2010-04-28T23:25:27+09:00 Subject: Re: navigate through folders "Andrei Caragea" wrote in message news:9e4d72ecab1db1084d4e364fb1de521c@ruby-forum.com... > Hello everyone, > > ok... I have file (file.txt) which is written by a script. In this given > file there's a path (c:/path/path1/path2) and I have the following code > in another script: > > File.open('file.txt').each_line do |p| > > Dir::chdir("#{p}") > { > bunch of code > } > > What I want to do after this is to go up to /path1 or /path and run some > more code; and this is where I'm stuck. > > Can anyone point me in the right direction? > > Thank you, > Andrei > -- > Posted via http://www.ruby-forum.com/. > From path2: Dir::chdir("..") # returns to path1 Dir::chdir("..\..") # returns to path Hth gfb