1

I git-cloned a repo for Linux divers(ath10k) having files named aux.h and aux.c.

Quoting the answer here,

MS-DOS Device Driver names cannot be used as file names in Windows. As a result, we are unable to name folders as con, aux, nul, etc.

Now I am stuck with those files and cannot delete them.

System:

Windows 10 Home  
Version 21H2  
OS build 19044.1645

Already tried (all commands executed with admin privileges):

3
  • Have you tried using a privileged command prompt to delete it?
    – Neo Darwin
    Commented May 1, 2022 at 8:57
  • Try a different Admin User (make one) and try Unlocker 1.92 (MajorGeeks)
    – anon
    Commented May 1, 2022 at 11:10
  • Try these two solutions : 1: command (as admin) del \\%computername%\c$\Users\Your_Path\aux 2 : Run bash with WSL, then you can use rm aux
    – S. Brottes
    Commented May 1, 2022 at 13:09

1 Answer 1

0

I had initially deleted the folder using Windows Explorer. But the files remained. Tried cmd after that, failed again.

Here's what finally did the job (should have thought of this earlier):

  1. Opened Git Bash.
  2. Went to the local repository's parent directory.
  3. Typed rm -rf Ath10k and hit Enter.

The ability of bash to bypass Windows restrictions seems concerning, though. Why was it even allowed?

Considering the fact that the files could not be opened on Windows,
the cloning process should have failed cleanly instead of creating problems further down the line.

2
  • 1
    Those are not deliberate restrictions in the security sense. They are special cases where certain names are "rerouted" to have a different purpose. It's a carry-over from DOS era that the NT kernel doesn't have (devices have a separate namespace), just emulates it for old apps and users, so you're only bypassing that emulation. It's a bit like how Bash on Linux has special handling for /dev/tcp but that doesn't affect non-Bash programs. Commented May 1, 2022 at 17:24
  • @user1686 Thank you for the explanation.
    – Kitswas
    Commented May 2, 2022 at 2:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .