From: Julian Leviston Date: 2009-02-05T11:00:12+09:00 Subject: Re: Dir.foreach() crash You mean backslashes. Yeah, use File::SEPARATOR or just use explicit strings - ie single quoted Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 05/02/2009, at 12:19 PM, 7stud -- wrote: > unknown wrote: >> I am getting the following error: >> >> D:/BackupScripts/trimMachines.rb:130:in `open': Invalid argument - >> x:\. >> \data\dubinin\vmap\v1180\soamafr\lib_180\trans\k\f\g\e >> (Errno::EINVAL) >> >> I've checked and the directory mentioned does exist, the user account >> has full access to the directory, the directory is not empty, the >> directory name is < 255 chars long, etc. >> >> This script works for millions of files with directories that have >> much longer names and many more subdirectories than this example >> failure. The failures happen routinely after a few days of running >> the >> script and always on different directories. >> >> Does anyone have a clue what the problem could be? Is this a Ruby >> bug? > > Forward slashes are dangerous in strings because things like \v are > escape characters? > -- > Posted via http://www.ruby-forum.com/. >