Max length of file names?

Hi,

I’m running Ruby 1.6.7 on cygwin on Win2k and it doesn’t seem to like
long filenames even though the file system allows and correctly handles
them. Why is that and is there a workaround?

$ ls
Ella Fitzgerald - Sings The Cole Porter Song Book Disc 2 - 19 - Let’s
Do It
(Let’s Fall In Love) - Alternative Take.mp3

$ cat /tmp/t.rb
s = "Ella Fitzgerald - Sings The Cole Porter Song Book Disc 2 - 19 -
Let’s Do It
(Let’s Fall In Love) - Alternative Take.mp3"
puts s.length
File.open(s, “r”) do |f|
puts f.read(10)
end

$ ruby /tmp/t.rb
120
/tmp/t.rb:3:in `open’: File or path name too long - "Ella Fitzgerald

  • Sings The Cole Porter Song Book Disc 2 - 19 - Let’s Do It (Let’s Fall
    In Love)
    • Alternative Take.mp3" (Errno::ENAMETOOLONG)
      from /tmp/t.rb:3

Regards,

Karsten

···


http://fastmail.fm - The way email should be…