How do I have two documents with exactly the same file name?

I’ve noticed that I have two documents with EXACTLY the same name, both are .ods spreadsheets, and one is a newer iteration of the other.
How is it possible that libreoffice has allowed this? Wouldn’t it normally require some kind of difference between one and the other?

Why would not LibreOffice allow that? given that files with exactly the same names are only possible in different directories. It’s user who decides if they need “file1.ods” in /dir/1/ and also “file1.ods” in /dir/2/.

You might want to provide slightly more information if you suspect that my guess is wrong; you might note that you haven’t provided enough information (specific file names copied/pasted, not re-typed; screenshots; OS info that could help suspect file names differing by case etc…) which could help us give anything better than a guess.

Wouldn’t it normally require some kind of difference between one and the other?

Yes - the path to the file.

LibreOffice does not enforce unique filenames. Most filesystems will enforce unique names within directory scope (unique within a folder).

Apps (like LibreOffice) must conform to the limitations set by the system in which it operates (the operating system such as Windows, MacOS or Linux, and storage facility filesystem such as NTFS, HFS, FAT)

Possible ways to have seemingly identical names, even with a “normal” filesystem which does not allow this:

  • The files in question are in different folders. The folder path is a part of “file identity”. Filename needs to be unique within the folder.
  • The filename extension is different. This extension is part of the file name, commonly used to indicate the type of file, but modern operating systems tend to hide the extension part of the name, instead relying on annotation and/or the icons which denote “default filetype handler”. If both your files show the .ods ending on the file name, this is not the reason in your case.
  • The file name contains spaces. Spaces are hard to see, in particular leading/trailing ones and single vs. double spaces.
  • Versioning. Modern file systems can hold multiple “streams”. This will appear as one name in your file manager, but it is possible to open a particular content stream, or version, or what you will. Aside of this, LibreOffice supports versioning internally (independent of file system).
  • Some file systems and some operating systems distinguish between upper and lower case for names, while others do not. It is conceivable (though I have never seen it demonstrated) that a conflicting handling of case between OS and filesystem may cause the issue you describe. For this to happen your system will have to be, or operate in, a heterogenous environment (multiple system platforms operating in conjunction).

A very common cause of “seeing double” is the system’s attemps at organizing files for you. “Recently used” is a special folder in some systems which will hold links to the files you have used recently. “Libraries” is an extension to this, holding links to the folders you commonly use. This will give different paths to the exact same content, so it probably does not apply in your case.

So, what is it that makes you experience your situation as “two different files”? How do you “experience duality”?

  • Do you see two entries in file manager?
  • Do you have two identical items in “recent files”?
  • Do you experience randomly different content each time you open said file?
  • Something else?

You can’t have several files with the same file name. You can have several versions of a document in a single file.