case sensitivity for file api

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

case sensitivity for file api

Vlad Dumitrescu XX (LN/EAB)
hi!
 
I stumbled upon this problem, as I usually work on Windows and the files are in a ClearCase view on Unix:
 
([hidden email]> io:format("~s~n", [os:cmd("dir s*tcap*.erl")]).
2006-01-30  13:23               29ÿ899 sS7_Tcap.erl
2006-01-30  13:23               31ÿ722 ss7_tcap.erl
2006-01-30  13:23               33ÿ767 ss7_tcap_subsystem.erl
ok
([hidden email]> f(L),L=filelib:wildcard("s*tcap*.erl").       
["ss7_tcap.erl","ss7_tcap_subsystem.erl"]
 
I guess that filelib and file use the local file driver, which for Windows is case insensitive. But since the network drive's filesystem isn't, there is a problem...
 
Is there anything to do about it, except running the node on Unix?
 
regards,
Vlad
 
Reply | Threaded
Open this post in threaded view
|

Re: case sensitivity for file api

Matthias Lang
Vlad Dumitrescu XX (LN/EAB) writes:

 > (test@EGILA003CTD0VFE)20> io:format("~s~n", [os:cmd("dir s*tcap*.erl")]).
 > 2006-01-30  13:23               29ÿ899 sS7_Tcap.erl
 > 2006-01-30  13:23               31ÿ722 ss7_tcap.erl
 > 2006-01-30  13:23               33ÿ767 ss7_tcap_subsystem.erl
 > ok
 > (test@EGILA003CTD0VFE)21> f(L),L=filelib:wildcard("s*tcap*.erl").        
 > ["ss7_tcap.erl","ss7_tcap_subsystem.erl"]

 > I guess that filelib and file use the local file driver, which for
 > Windows is case insensitive.

I would draw the exact opposite conclusion from the information you've
given, i.e. that whatever mechanism filelib uses, it must be case
_sensitive_. Which is exactly as per the filelib manpage.

Out of curiosity, how did you pick the hostname "EGILA003CTD0VFE"?

Matthias
Reply | Threaded
Open this post in threaded view
|

RE: case sensitivity for file api

Vlad Dumitrescu XX (LN/EAB)
In reply to this post by Vlad Dumitrescu XX (LN/EAB)
Hi

> f(L),L=filelib:wildcard("s*tcap*.erl").        
>  > ["ss7_tcap.erl","ss7_tcap_subsystem.erl"]
>
> I would draw the exact opposite conclusion from the
> information you've given, i.e. that whatever mechanism
> filelib uses, it must be case _sensitive_. Which is exactly
> as per the filelib manpage.

Ouch, I should have tested with
        L=filelib:wildcard("s*cap*.erl").        
Which gives the proper result... Sorry for the confusion.

My problem is that I can open a file from a network drive and read from
it. When saving it, however, the other files which only differ in
capitalization are being overwritten... I've checked not and it's the
same when using Emcas, so it's not an Erlang issue.
 
> Out of curiosity, how did you pick the hostname "EGILA003CTD0VFE"?

That was my nickname when I was a little boy :-)
No, the name is automatically assigned and I don't really want to be
associated with it ;-)

Regards,
Vlad
Reply | Threaded
Open this post in threaded view
|

RE: case sensitivity for file api

Vlad Dumitrescu XX (LN/EAB)
In reply to this post by Vlad Dumitrescu XX (LN/EAB)
Hmmm, something is weird after all :-)


Running ls() gives
...
ss7_sys.erl              
ss7_tcap.erl              
ss7_tcap_subsystem.erl    
tcap.erl                  
...

So sS7_Tcap.erl isn't visible there. Maybe it's file:list_dir() that
uses the local file driver after all?

Regards,
Vlad
Reply | Threaded
Open this post in threaded view
|

Re: case sensitivity for file api

Raimo Niskanen
In reply to this post by Vlad Dumitrescu XX (LN/EAB)

I guess you already know this, but there should be a
setting in the ClearCase administration tool on Windows that
selects if names should be case sensitive or not.
(Jumping in the middle of something I did not read from the start)


[hidden email] (Vlad Dumitrescu XX LN/EAB) writes:

> Hi
>
> > f(L),L=filelib:wildcard("s*tcap*.erl").        
> >  > ["ss7_tcap.erl","ss7_tcap_subsystem.erl"]
> >
> > I would draw the exact opposite conclusion from the
> > information you've given, i.e. that whatever mechanism
> > filelib uses, it must be case _sensitive_. Which is exactly
> > as per the filelib manpage.
>
> Ouch, I should have tested with
> L=filelib:wildcard("s*cap*.erl").        
> Which gives the proper result... Sorry for the confusion.
>
> My problem is that I can open a file from a network drive and read from
> it. When saving it, however, the other files which only differ in
> capitalization are being overwritten... I've checked not and it's the
> same when using Emcas, so it's not an Erlang issue.
>  
> > Out of curiosity, how did you pick the hostname "EGILA003CTD0VFE"?
>
> That was my nickname when I was a little boy :-)
> No, the name is automatically assigned and I don't really want to be
> associated with it ;-)
>

Just like often the case is regarding nicknames on grown up boys :-)

> Regards,
> Vlad

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB
Reply | Threaded
Open this post in threaded view
|

Re: case sensitivity for file api

Vlad Dumitrescu
From: "Raimo Niskanen" <[hidden email]>
> I guess you already know this, but there should be a
> setting in the ClearCase administration tool on Windows that
> selects if names should be case sensitive or not.
> (Jumping in the middle of something I did not read from the start)

Yes, but the issue is that there are files whose names only differ by case.
They are all needed. The problem is that when compiling from Windows I only
get one beam file.

regards,
Vlad