LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Curious: How (the #) are filename conflicts avoided in a linux environment? (https://www.linuxquestions.org/questions/linux-software-2/curious-how-the-are-filename-conflicts-avoided-in-a-linux-environment-895170/)

kopatops 08-02-2011 04:22 PM

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.

knudfl 08-02-2011 04:49 PM

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.

..

kopatops 08-02-2011 05:12 PM

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... :scratch:

Thanks for answering.:)

knudfl 08-02-2011 05:23 PM

I don't think there is any coordination of file names.
Everybody can develop, what they want.
But it's best to avoid reusing a name / file names.

Easy to search with Google : <name> rpm
Or Google : <name> software.

And the Debian file search : Search → Package contents
http://packages.debian.org/search?se...&keywords=echo

..

MTK358 08-02-2011 05:33 PM

Quote:

Originally Posted by kopatops (Post 4432023)
It's fascinating to me how this isn't more of a problem than it seems... :scratch:

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).

kopatops 08-02-2011 06:06 PM

Quote:

Originally Posted by MTK358 (Post 4432032)
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 :p. I understand that, when any conflict arises, it isn't too tedious for the user to fix.

chrism01 08-02-2011 06:48 PM

I don't think there's an official list of 'already used' names for stuff generally.

Within a specific project eg the kernel, then the src ctrl sw eg git should stop you creating a 2nd item with the same name.

I think a general soln would be to search in google, or use 'find' across your whole system and/or check in http://linux.die.net/man/

sundialsvcs 08-02-2011 07:46 PM

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.


All times are GMT -5. The time now is 02:37 PM.