philsivyer
asked on
RUBY CHANGE DIRECTORY
Hello
I am brand new to ruby and was wondering how I can open a file in a different directory.
My current script (Phil.rb) reads as follows and is in the same directory as my text file (SC6.TXT).
File.open("SC6.TXT").each { | line | puts line}
lets say the my SC6.TXT file was in another directory such as - F:\Phil\Ruby\SC6.TXT
What would be the change in my script to open my text file in F drive?
Thanks
Phil
I am brand new to ruby and was wondering how I can open a file in a different directory.
My current script (Phil.rb) reads as follows and is in the same directory as my text file (SC6.TXT).
File.open("SC6.TXT").each { | line | puts line}
lets say the my SC6.TXT file was in another directory such as - F:\Phil\Ruby\SC6.TXT
What would be the change in my script to open my text file in F drive?
Thanks
Phil
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.