Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case Sensitive Support in Windows #14724

Closed
tc-jschaefer opened this issue Feb 13, 2024 · 3 comments
Closed

Case Sensitive Support in Windows #14724

tc-jschaefer opened this issue Feb 13, 2024 · 3 comments

Comments

@tc-jschaefer
Copy link

Description of the Issue

On Windows 10 (with a build supporting case-sensitive files and WSL, and using file system NTFS), when attempting to save new files (with different case-sensitive names, but otherwise identical when case-folded) to a folder with "setCaseSensitiveInfo" enabled, the user receives an error and cannot save.

Other strange behaviors occur with case-sensitive files, such as being unable to open both files at the same time, within the same instance of N++.

Steps to Reproduce the Issue

  1. Click "File"
  2. └─ Click "New"
  3. Type anything (to enable saving)
  4. Click "File"
  5. └─ Click "Save"
  6.      └─ Select a folder with attribute "setCaseSensitiveInfo" enabled.
  7. Type "test.txt"
  8. └─ Click "Save"
  9. Click "File"
  10. └─ Click "New"
  11. Type anything (to enable saving)
  12. Click "File"
  13. └─ Click "Save" (the previous folder with attribute "setCaseSensitiveInfo" enabled will already be the currently selected folder)
  14. Type "TEST.TXT"
  15. └─ Click "Save"
  16. Get error "The file is already opened in Notepad++."

Expected Behavior

The file should save without error.

Actual Behavior

User receives error "The file is already opened in Notepad++.", and cannot proceed.

Debug Information

Notepad++ v8.5.7 (32-bit)
Build time : Sep 6 2023 - 23:07:35
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line : "C:\Users\jschaefer\Documents\TrialCard\CaseSensitive\TEST.TXT"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 22H2
OS Build : 19045.2965
Current ANSI codepage : 1252
Plugins :
JSMinNPP (1.2107.2)
mimeTools (2.9)
NppConverter (4.5)
NppExport (0.4)
PoorMansTSqlFormatterNppPlugin (1.6.13.31502)

NOTE

If you don't have WSL already enabled, you'll need to run this in PS and then restart:
• Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Also, to mark a folder as case-sensitive, you can use this command:
• fsutil.exe file setCaseSensitiveInfo enable

@xomx
Copy link
Contributor

xomx commented Feb 15, 2024

when attempting to save new files (with different case-sensitive names, but otherwise identical when case-folded) to a folder with "setCaseSensitiveInfo" enabled, the user receives an error and cannot save.

I have not tried to reproduce/debug this issue but I think I know where the problem is - for some compatibility reason (#11196 (comment)) the N++ does not use the required FILE_FLAG_POSIX_SEMANTICS flag in its saving CreateFile call.

Other strange behaviors occur with case-sensitive files, such as being unable to open both files at the same time

As the N++ currently uses the CRT fopen (which is AFAIK only case insensitive on the Windows platform) for its file-reading, I do not think that this is possible (without replacing with that WIN32 IO CreateFile & FILE_FLAG_POSIX_SEMANTICS way).

@donho
Copy link
Member

donho commented May 5, 2024

@donho donho reopened this May 5, 2024
@donho
Copy link
Member

donho commented May 5, 2024

In Windows file system, insensitive case of file path is used in the most of environment.
Notepad++ treats the following command
.\notepad++.exe .\config.Xml .\config.xmL as .\notepad++.exe .\config.Xml
and it's the correct treatment for 99% of users.

However there's no way to determinate which situation we are in. (if sensitive case is ON or OFF)
As a result, the case seNsitiVe in Windows will not be supported in Notepad++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants