Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

As mentioned, what is the difference? or is there any concern to use them?

share|improve this question
add comment

2 Answers 2

Unlike DOS-based OSes, in Unix and Linux file extensions are mostly meaningless outside of human-readable reasons. INI is a configuration file standard.

A .conf file could be an INI file, or it could be any other configuration system that the application supports. MySQL, for example, uses the file my.cnf by default for configuration, which is an INI file.

share|improve this answer
1  
Are .ini files carry overs from Windows coders? –  Rob Nov 6 '12 at 14:19
    
@Rob Kindof, but not really. It is like many programs will use an extension that defines the format (openbox's .xml config for example). There isn't really a solid convention. Personally I put the filetype as an extension if I use one (which I usually don't). –  Kevin Cox Nov 6 '12 at 20:15
add comment

INI files has a format roughly like this:

[heading1]
key1=value
key2=value

[heading2]
a=1
b=2

etc...

The line endings are usually 10 13 (\n\r, windows style) instead of just 10 (\n, unix style).

Conf files, on the other hand, are more varied. They may have the same formatting as ini files, or something completely different, like this:

# A comment
button 1 {
  name "hello"
  "text" hi.there
  "more..." {
    "something 123"  bla.bla "123"
  }
}

# Another comment
button 2 {
  # hello
}

you get the idea...

.conf files usually have the unix style line endings, at lest on unix-like systems. It is frowned upon for .conf files on unix-like systems to have windows style line endings.

TL;DR; ini files usually have windows style line endings and a fixed layout, while conf files have their roots in unix-like systems and can have almost any kind of layout

share|improve this answer
    
There is nothing about the INI standard that says that ini files need DOS line endings. My php.ini file doesn't have them. –  jordanm Nov 6 '12 at 18:14
    
jordanm, I did write "The line endings are usually ...". –  Alexander Nov 6 '12 at 18:44
2  
do you have an example of such a UNIX application that expects its line endings to be DOS-style? –  jordanm Nov 6 '12 at 19:59
    
This is pretty much my understanding, too. –  Rob Nov 6 '12 at 20:42
1  
and the line endings have nothing to do with the file format, it's just a normal text file with the usual system line endings. Most INI files use dos line endings because most INI files are on windows machines. –  Kevin Nov 7 '12 at 13:31
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.