Re: Error: file name for OPEN is too long
- Posted by Matt Lewis <matthewwalkerlewis at gm?il.co?> Dec 20, 2007
- 500 views
Juergen Luethje wrote: > > Matt Lewis wrote: > > > It seems reasonable to pick these values up from the platform correct > > headers. > > > > Matt > > I agree. > Also, wouldn't it be better when Eu returns -1 (or maybe -2 ?), when > a path/file name is too long, rather than causing the program to crash? > For my program that crashed a few days ago, I'll write a wrapper for > open() with this behaviour. That makes a lot of sense to me. I didn't even really notice the RTFatal call there. Perhaps Rob can chime in (if he remembers) about why it's a fatal error rather than a failed open? And since we have information about why the file failed, it does make sense to report this. The only issue is that we will break code that tests:
if fn = -1 then
Granted, this is a very rare occurrence (and even more so on Linux and BSD, given the max path lengths that they have). I don't think I've ever encountered this problem, myself, although I think I've been close. If you do anything down in the depths of "My Documents" then it's a definite possibility. Maybe one answer is to switch over to the unicode version behind the scenes for windows, and try it that way? Matt