How can the recycle bin hold multiple files with the same name? [duplicate]

Solution 1:

The Recycle Bin is not a "normal" folder and, thus, does not have to abide by the same rules you know from regular folders.

When you delete a file, the entry for that file in the file system is marked as deleted. The file itself (or, to be more precise, the data contained in the file) remains in place. Windows will then put a new entry into the file system with a new file name. This entry will refer to the same location in the file system where the original file was located. Additionally, it will keep a reference to the original, deleted file.

If we take a look at the actual contents of the Recycle Bin folder, we see this:

C:\$Recycle.Bin>dir /a
 Volume in drive C is System
 Volume Serial Number is 7461-FCF4

 Directory of C:\$Recycle.Bin

2013-01-30  16:53    <DIR>          .
2013-01-30  16:53    <DIR>          ..
2013-01-30  16:53    <DIR>          S-1-5-20
2011-11-29  15:28    <DIR>          S-1-5-21-2370250818-2711005194-4184312249-1165
2013-04-30  14:36    <DIR>          S-1-5-21-395480114-2448312134-3943194674-1000
               0 File(s)              0 bytes
               5 Dir(s)  74,019,328,000 bytes free

This shows me the folders that were deleted from my C: drive. If I look into one of those folders, I can see the deleted files with their new names:

C:\$Recycle.Bin>dir S-1-5-21-2370250818-2711005194-4184312249-1165
 Volume in drive C is System
 Volume Serial Number is 7461-FCF4

 Directory of C:\$Recycle.Bin\S-1-5-21-2370250818-2711005194-4184312249-1165

2011-11-29  15:04               544 $I8CQG1I.old
2011-11-29  15:04               544 $IB7OVE3.attr
2011-11-29  15:28               544 $ICLKJI9.csr
2011-11-29  15:28               544 $IJS204F.csr
2011-11-29  15:04               544 $IMBRKUS.old
2011-11-29  15:04               544 $IURO2ZD.old
2011-11-29  15:04               544 $IV2TEJ7.pem
2011-11-29  15:04               544 $IWDACDF.pem
2011-11-29  14:37                21 $R8CQG1I.old
2011-11-29  14:41                21 $RB7OVE3.attr
2011-11-29  14:35               538 $RCLKJI9.csr
2011-11-29  15:11               364 $RJS204F.csr
2011-11-29  14:37                37 $RMBRKUS.old
2011-11-29  14:37                 3 $RURO2ZD.old
2011-11-29  14:41             2,613 $RV2TEJ7.pem
2011-11-29  14:37             2,973 $RWDACDF.pem
              16 File(s)         10,922 bytes
               0 Dir(s)  73,465,004,032 bytes free

So, you see, the 2 deleted files in your Recycle Bin are 2 unique instances that don't conflict with each other (although, there would be a conflict if you tried to restore both at the same time).