Eli5 Why can’t there be 2 files with the same name in the same directory but in the recycle bin, it’ll allow it?

1.37K views

Eli5 Why can’t there be 2 files with the same name in the same directory but in the recycle bin, it’ll allow it?

In: Technology

8 Answers

Anonymous 0 Comments

A few reasons: either the two copies of the same file were actually from different locations/folders – so technically they’re _different files_, or they’re different copies of of the same file (i.e. same “Original Location”) but from different times.

Anonymous 0 Comments

Normally; the filename is an important part of the file path. Thus, filenames must be unique.

In the recycle bin, the filename is *not* a part of the file path, entirely because the recycle bin is special.

Anonymous 0 Comments

Because when you put something in the Recycle Bin, you’re not “physically” moving it to the Recycle Bin. From Windows’ perspective those files are still in their original folders, but… not. It’s really just a special way for the computer to show you there are files you marked to delete. And the data on the hard drive itself has not moved at all.

Anonymous 0 Comments

Because there’s metadata showing where they came from. They’re the same file name, but not the same path. Or are you saying same name and same path?

If it’s the latter, I’d presume because they have different creation times. Try restoring all of them and see what happens.

Anonymous 0 Comments

Windows keeps track of files in a path format. For example, something on your desktop would be `C:/users/<user>/Desktop/file.txt`. Problem is that you can’t have multiple `file.txt`’s on your desktop and keep a unique path at the same time. The recycle bin isn’t a physical folder, rather just a listing of files that have been recently deleted. Files in the recycle bin don’t have a path or directory listing, therefore don’t need a unique filename.

Anonymous 0 Comments

When Windows moves a file into the Recycle Bin, it actually renames it. For instance, I just put an empty file called Test.TXT into my Recycle Bin and then looked at the appropriate location using Powershell, and I can see there are now two files in there: $I6A9Y6N.txt and $R6A9Y6N.txt. One of these is the actual file, moved and renamed, and the other is a file containing the information of where that file came from and its original name. If I put another Test.TXT in there then another two .TXT files with weird names show up, and so on.

Anonymous 0 Comments

This is not a ELI5 but it can be done.
Technically you can but it requires some funky steps, git knowledge and you can’t really see it in windows but they are both there.
So the file system in windows are case insensitive. That means that windows sees file.jpg and File.jpg as the same file.
Linux and Macos can be installed with a case sensitive file system, I don’t know if windows allows this. So the files file.jpg and File.jpg is seen as two different files.
Now if you create a Git repository on a case sensitive file system you can create the before mentioned files, file.jpg and File.jpg. Push them to a remote repository. Now you have to pull the remote Git repository to a windows computer. You now have two files “with the same name” on windows. This will make git think there are changes when the is non as far as I remember.

I’m on mobile so formatting isn’t top notch.

Anonymous 0 Comments

There is no technical reason for it anymore. Any modern day file system uses an internal unique identifier (eg inode) for the file. The name is there just for the user convenience. There are some special files in windows that cannot be created though, because they mean something special in the system. E.g. CON.