Curious: How (the #) are filename conflicts avoided in a linux environment?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Curious: How (the #) are filename conflicts avoided in a linux environment?
This might be a question for developers and distribution-specific package maintainers respectively. Since google wasn't my friend today, I'll humbly ask here:
1.
I've never ever encountered a "file already exists in filesystem" error when installing a new package (for the Arch Linux dist) - unless a previous version of the package was somehow forgotten by my package manager (pacman). Have I just been lucky, or do package maintainers keep a list of each and every path occupied by files of previous packages? Neither?
2.
What needs to be considered by the developer of a piece of software when it comes to something as trivial as names of files produced by the source? Names of binaries, for example, don't seem to be entirely random, but descriptive of what the binary/library does in runtime. If I wanted to name my new amazing piece of software (which is not GNU echo) 'echo', what would primarily make me decide otherwise?
Is there any "centralization" with regards to what names cannot (should not) be used in a given situation?
If this question hasn't made it clear - I am not experienced in software development, so this might be a stupid question, but for some reason it has bothered me for a while. I'd appreciate it if you'd share some knowledge about the matter.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,518
Rep:
1 - 2 : The word / file name, say 'echo' can be used in a different spelling,
to avoid conflicts. Google translate will show 'echo' in other languages.
Echo examples : ekko eco exo kaiku.
Conflicts are not always considered. Linus developed git :
Git version control / revision control software.
And there already was a tool by that name : GIT, Gnu Interactive Tool.
( Debian then used the name git-core for the new git.)
P.S. : A lot of software names are Copyright protected.
So it is necessary to do some investigation before using a name.
So basically, if I do a 'make install' of a program, and 3 of the files built have the same name as others already in the filesystem, it's up to me to make modifications in the source?
And package maintainers (such as Debian, which you mention) generally do this for me? (I should probably post in the Arch forum as well)
It's fascinating to me how this isn't more of a problem than it seems...
It's fascinating to me how this isn't more of a problem than it seems...
It's hardly a problem at all if no one uses the same name for two pieces of software. If there's already and "echo" command, you don't name your program "echo" (or if you really want to call it "echo", use a name other than "echo" for the binary file itself).
It's hardly a problem at all if no one uses the same name for two pieces of software. If there's already and "echo" command, you don't name your program "echo" (or if you really want to call it "echo", use a name other than "echo" for the binary file itself).
This is exactly my point; The names of files built for a tool called 'cat' may coincide with other files built for a tool called 'dog'. It's not only the binaries either I suppose, but any configuration files required to run. Who knows what 'dog' developers name their files.
I'm still fascinated, be it stupidity or otherwise . I understand that, when any conflict arises, it isn't too tedious for the user to fix.
Linux and Unix have a few loosely-adopted conventions. One is that "official" stuff goes into places like /usr/bin, and that there is an entire /usr/local subtree that is specifically meant to be "the private play-pen of this computer."
That having been said, yes, files can be unintentionally overwritten, and no, package developers are not perfect. There is no "generally accepted standard 'installer'" on a Unix/Linux system (in general), and even packages can have flaws in their design.
The thing that keeps most things clean, most of the time, is rigorous testing before release.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.