I am getting an error when I try to write a file in Ruby v2.3.3 to a folder on Windows.
This is code that I've used many times before and it's worked fine.
File.open(file_name, "w+") { |out| out.puts "Hello" }
This works for short file names, but apparently fails around 200 character files names (including the folder path). The error I get is that the file or folder does not exist. The method is creating the file, so it obviously does not need to exist beforehand. And the folder definitely does exist -- I tested that many times. So I do not understand the error message.
I tried running this with a somewhat shorter file name, and then it worked fine.
Is there a way around this error? Is this really a Ruby error, or more like a Windows limitation?