troubleshooting Question

RUBY CHANGE DIRECTORY

Avatar of philsivyer
philsivyer asked on
Ruby
1 Comment1 Solution1610 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Gertone (Geert Bormans)
Information Architect
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros