Dennis Mendelson wrote:
Should have mentioned that I have tried using double-quotes in the
following ways:"C:\Documents and Settings\test.txt"; and
puts "C:\Documents and Settings\test.txt"
C:Documents and Settings est.txt
=> nil
Notice something? You need double backslashes in double quotes.
Alternatively use single quotes
puts 'C:\Documents and Settings\test.txt'
C:\Documents and Settings\test.txt
=> nil
C:\"Documents and Settings"\test.txt, both of which Windows
recognises.
This is incorrect Ruby syntax:
C:\"Documents and Settings"\test.txt
SyntaxError: compile error
(irb):2: syntax error
C:\"Documents and Settings"\test.txt
^
(irb):2: syntax error
C:\"Documents and Settings"\test.txt
^
from (irb):2
Note, ruby != bash
Kind regards
robert