1

I am using WSL1.

  • I am trying to save a copy of my ~./miniconda/envs folder to the desktop using cp.

  • I keep getting errors like cp: cannot create regular file './envs/py_env/share/terminfo/h/hp2621a': File exists

  • The problem is that there are 2 files with the same name but different case. For example, hp2621a and hp2621A.


Example:

Original Folder: hp2621a, hp2621A, etc

Using cp I get:

  • New Folder: hp2621A, etc
  • Missing: hp2621a

  • Some of the subdirectories of py_env/share and py_env/lib also have a similar problem (A and a seemed to conflict)

  • I was able to solve some of these errors by changing the name of a directory from A to A_1.

NotTheDr01ds
  • 22,082
Elijah
  • 111

1 Answers1

0

From the comments, it looks like you've found this already -- There's some good documentation on why this is happening and how to handle it.

By default, folders on Windows NTFS drives are case-insensitive; A and a are the same filename. However, for some time now (since 2018) Windows has the ability to specify case-sensitivity on a directory-by-directory (and inheritable) basis. To do so:

  • The directory where you place these files will need to be empty to start with. Either remove everything from the existing directory or create a new empty directory on the desktop. We'll assume the name of this directory is $env:USERPROFILE\Desktop\env.

  • From PowerShell, run:

    fsutil.exe file setCaseSensitiveInfo $env:USERPROFILE\Desktop\env enable
    

That should be all that is needed for your cp command to work properly. If not, though, see the doc page for some more options and details.

NotTheDr01ds
  • 22,082