<style> p {margin-top:0px;margin-bottom:0px;} </style> <table border=0 width=100%% cellpadding=0 cellspacing=0 align=center> <tr> <td valign=top style='padding:8pt;'><font size=2><br>I can at least tell you that in Windows via Cygwin (pretty much acting like a Unix system) does gives out an error, as it should.<br><br>1> c(myTest).<br>{ok,myTest}<br>2> c(mytest).<br>** Module name 'myTest' does not match file name 'mytest' **<br>{error,badfile}<br><br>The behavior you're experiencing is Window SOP. The deal with Unix or Unix-like systems is that you can have file 'test.erl' and also file 'Test.erl,' but not in Windows, as they would be exactly the same file (even under Cygwin). Hence, there's no problem!<br><br>Cheers, Alex<br><br><br><blockquote style="border-top: 1px solid rgb(204, 204, 204); margin: 0.8ex 0pt 0pt; padding-bottom: 1ex;"><br>---------[ Received Mail Content ]----------<br><br> <b>Subject : </b>[erlang-questions] Case insensitivity - Window!
s trap or bug?<br><br> <b>Date : </b>Tue, 15 Jan 2008 13:14:04 -0800<br><br> <b>From : </b>Doug Edmunds <dae@douglasedmunds.com><br><br> <b>To : </b>erlang-questions@erlang.org<br><br><br><br>The Erlang compiler assumes that filenames are<br><br>case sensitive. It does not check the existence<br><br>of a file based on a case-sensitive spelling.<br><br>But Windows filenames are not case sensitive.<br><br>This can lead to unexpected results.<br><br><br><br>(I don't have a *nix system to check this on. I<br><br>assume this is a Windows-only problem.)<br><br><br><br>------<br><br>Assume this scenario:<br><br>(note the spelling, a capital T in both file name and module).<br><br><br><br>a file named: myTest.erl<br><br>containing a module: -module(myTest).<br><br><br><br> > compile:file(myTest).<br><br>produces myTest.beam<br><br><br><br>So far so good.<br><br><br><br>------<br><br><br><br>An inadvertent typo can cause unexpected results<br><br>which are not flagged b!
y the compiler (in Windows):<br><br><br><br>1.<br><br><br><br> > co
mpile:file(mytest). %% case insensitive input accepted.<br><br>{ok,myTest} %% note difference between input and output<br><br><br><br>What is the filename just created?<br><br>'mytest.beam', not 'myTest.beam'<br><br><br><br>Any errors or warnings? No.<br><br><br><br><br><br>----<br><br><br><br>2. Having done step 1, things can become very strange:<br><br>Remember, the name of the beam file is mytest.beam.<br><br>There is no myTest.beam.<br><br><br><br> > code:file_load(myTest).<br><br>{module,myTest} %% loads<br><br><br><br><br><br>3. But this doesn't work:<br><br><br><br> >code:file_load(mytest).<br><br><br><br>=ERROR REPORT==== 15-Jan-2008::09:56:50 ===<br><br>beam/beam_load.c(1035): Error loading module mytest:<br><br> module name in object code is myTest<br><br><br><br><br><br>=ERROR REPORT==== 15-Jan-2008::09:56:50 ===<br><br>Loading of c:/erl_dae2/compile sensitivity bugs/mytest.beam failed: badfile<br><br>{error,badfile}<br><br><br><br>--------!
-<br><br><br><br>Running erlc from a DOS shell, has the same problems.<br><br>erlc ignores case, and compiles a beam<br><br>file that does not match the internal module name.<br><br><br><br>erlc mytest.erl %% erlc accepts this filename in Windows<br><br><br><br>produces mytest.beam from myTest.erl without any warning.<br><br>The mytest.beam will have the same usage issues as indicated<br><br>above (it will contain a module name 'myTest' and will not load.<br><br><br><br>-------------------<br><br>I think of these as bugs. Other Erlang functions<br><br>can capture/retain filename case sensitivity in Windows.<br><br>(c:ls/0, for example reports myTest.erl). You won't change<br><br>Windows. The Erlang compiler functions need to test<br><br>for file existence based on case-sensitivity.<br><br><br><br>Doug Edmunds<br><br><br><br><br><br>_______________________________________________<br><br>erlang-questions mailing list<br><br>erlang-questions@erlang.org<br><br>http://www.erl!
ang.org/mailman/listinfo/erlang-questions<br><br></blockquote></font><
/td></tr>
</table>