Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2001-03

Lower case filenames

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter Vreman
Show quoted text 29 lines
Hello: I think that unit filenames should always be lowercase (or upercase). Pascal is case insensitive, so it must assume that filenames are case insensitive too. If the file system is not case insensitive, pascal has to make decision: all upper or all lower. let's say this unit name "myunittest", and a search path ./dir1:./dir2 and we have these files: /dir1/myunittest.PP /dir1/MYUNITTEST.pp /dir1/MyUnitTest.pp /dir2/MYUNITTEST.PP /dir2/myunittest.pp I know that who has such files deserves hell. but, which unit the compilier will select? the first one? will try first all lower? There is not an obvious decision. IMHO having the unit identifier, the compiler must select a exactly filename that is unique for the file system, all upper, all lower, or what ever you want. If that file exists in the search path: good news, if it doesn't: raise error. But trying to guess if the user changed the case, can be a source of confusion.

Having:

uses
  MyUnitTest;

the 1.1 compiler will look in this order:

/dir1/myunittest.pp
/dir1/MyUnitTest.pp
/dir1/MYUNITTEST.PP
/dir2/myunittest.pp
/dir2/MyUnitTest.pp
/dir2/MYUNITTEST.PP

Reply by email