From: Dave Thomas Date: 2002-05-07T12:38:51+09:00 Subject: Re: require and case Marko Schulz writes: > > that rb_require should normalize all paths before executing, and > > should store those normalized paths in $". > > That will likely break scripts that fiddle around with $:. So it > probably is unwise to change it in a minor release. Surely the only way it could break a script is that if that script currently manipulates $: in order deliberately to require the same file twice. Making names canonical before storing them in $" _removes_ the impact of changing $:, doesn't it? However, I have had problems with scripts that manipulate $: loading the same file twice: that was an issue with rubicon for a while. > > Thus on a Windows box the names should be converted to lower case > > and expand_path called. > > Does expand_path() solve the problem that on pre-NTFS-filesystems > every file with a name that is too long has two different names? > parsedate.rb vs. parsda~1.rb No idea - maybe it isn't expand_path, but something else that returns the canonical name. I'll happily leave that to someone who understands Windows. > > On a Unix both, the case should be left unchanged but expand_path is > > called. > > expand_path() doesn't resolve symbolic links. > > If there is more than one hard link to a file it is impossible to > determine _the_ correct name. I don't know NTFS, but this might be an > issue there too. We could store the inode number instead. > And there are so many special cases how a file may be addressed that > it is virtually impossible for ruby to ensure that a file gets loaded > only once. So IMHO it should stick with the simple and understandable > route it takes at the moment. The current scheme _has_ bitten me - not because of the case of file names, but because "./fred" is different to "fred". That surprised me. Dave