This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 198946 - Problem with directory case from Win to Unix Samba
Summary: Problem with directory case from Win to Unix Samba
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.0
Hardware: PC Windows 7 x64
: P3 normal with 1 vote (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-27 10:45 UTC by sgunfio
Modified: 2012-05-29 05:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sgunfio 2011-05-27 10:45:04 UTC
Hi,
i've a project stored on a samba server,
if i rename a directory in file system then refresh, the system is unanble to detect the changement, also if i've two subdirectories  with the same name, but differetne case, I get  just one (e.g. Pages and pages)

Thank you
Comment 1 Jaroslav Tulach 2011-05-27 13:16:47 UTC
Are you running on a window machine? Your samba server is using some Unix/case sensitive filesystem? If so, then I can imagine the mess...
Comment 2 sgunfio 2011-05-27 20:30:08 UTC
(In reply to comment #1)
> Are you running on a window machine? Your samba server is using some Unix/case
> sensitive filesystem? If so, then I can imagine the mess...

Win7 on an ubuntu box via samba.
It's like netbeans is performing an no-case comparison:
if is already in the tree don't add / update the information
Comment 3 Jaroslav Tulach 2011-07-28 15:17:58 UTC
(In reply to comment #2)
> Win7 on an ubuntu box via samba.

To rephrase: you are running Ubuntu Linux. Inside of VirtualBox you have running Win7 and you are accessing the filesystem of Ubuntu Linux via samba.

I can probably create some system property that would define whether files should be case sensitive or not and you could use it to override the defaults.
Comment 4 Jaroslav Tulach 2011-11-04 13:07:03 UTC
Is there a native API to query the case sensitivity of FS?
Comment 5 Vladimir Voskresensky 2011-11-07 10:28:03 UTC
(In reply to comment #4)
> Is there a native API to query the case sensitivity of FS?
we do it from Java like:
    static {
        boolean caseSenstive;
        try {
            File tmpFile = File.createTempFile("CaseSensitiveFile", ".check"); // NOI18N
            String absPath = tmpFile.getAbsolutePath();
            absPath = absPath.toUpperCase();
            caseSenstive = !new File(absPath).exists();
            tmpFile.delete();
        } catch (IOException ex) {
            caseSenstive = Utilities.isUnix() && !Utilities.isMac();
        }
        TRUE_CASE_SENSITIVE_SYSTEM = caseSenstive;
    }

    public static boolean isSystemCaseSensitive() {
        return TRUE_CASE_SENSITIVE_SYSTEM;
    }

of course you can do the same on any mounted disk without creating temp file,  i.e. get existing file from list of existing files and check if Upper/Lower search returns the same java.io.File
Comment 6 Jaroslav Tulach 2012-05-28 08:57:16 UTC
Finally I managed to do something with this issue: ergonomics#be300d5b00bc. Let me know if it addresses your problem a bit.
Comment 7 Quality Engineering 2012-05-29 05:45:32 UTC
Integrated into 'main-golden', will be available in build *201205290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/be300d5b00bc
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #198946: Giving users a chance to specify whether their filesystem is 'sensitive' or 'insensitive' using the 'org.netbeans.modules.masterfs.case' property.