Ruby Forum Test > Passing a directory in and using it to do a chdir

Posted by Clayton Rocker (clayhdl)
on 04.10.2007 22:29
Ruby newbie here,

I want to pass in a directory path and perform a chdir but I get the
following error:

testdir.rb:5:in `chdir': Invalid argument - 'c:\' (Errno::EINVAL)
        from testdir.rb:5

Script:

print "Enter Working Directory Path: "
sLoc = $stdin.gets
puts sLoc
Dir.chdir(sLoc)
puts Dir.pwd