Results 1 to 10 of 10
Hi ,
In windows we can create ini file using winAPI but i want to know how to create ini file in Linux.I am beginner in Linux.
Thanks in advance,
...
- 07-31-2007 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 4
How to create ini file in linux
Hi ,
In windows we can create ini file using winAPI but i want to know how to create ini file in Linux.I am beginner in Linux.
Thanks in advance,
A....
- 07-31-2007 #2
ini files for what, exactly?
Stand up and be counted as a Linux user!
- 08-01-2007 #3Just Joined!
- Join Date
- Jul 2007
- Posts
- 4
ini file for log file ,consider in general.
- 08-01-2007 #4
Sorry, I must be thinking of the wrong type of ini file. The ones I've seen in Windows are ASCII text files that specify settings for a particular program, which the program reads as it starts up so that it knows how to behave. (A notable example is win.ini.)
Do you have any links to examples of the kind you're talking about?Stand up and be counted as a Linux user!
- 08-01-2007 #5Just Joined!
- Join Date
- Jul 2007
- Posts
- 4
Yaa similar to what u thought ,that can be done on Windows using
getprivateprofilestring function ,let me as such anything in Linux??
Thanks
A
- 08-01-2007 #6
I think you would just use fscanf to read a configuration file...
- 08-01-2007 #7Just Joined!
- Join Date
- Jul 2007
- Posts
- 4
Ha its not reading its creating a ini file
- 08-01-2007 #8
Then use open a pointer to a file and append or write what you need to the file? Linux is not Windows.
- 08-01-2007 #9
I've never programmed with the Win32 API, but I believe I understand what you're saying (it's similar to Mac OS X). Basically, your ini file holds preferences, and you interact with it through some sort of preference manager function.
Well, since Linux programming is not generally done in a framework, this doesn't work any longer. Your preference file can be whatever you want, wherever you want, in whatever format you want. You decide, and manage it yourself. Some popular formats are a basic key-value pairing, XML, YAML, etc., but you really can make any format you want.
And to do anything with it, you just open it up as you would any file, and have a go.DISTRO=Arch
Registered Linux User #388732
- 08-01-2007 #10Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Hi.
There are perl modules that can process INI files. For example:
And possibly someone may drop by with information on similar features in, say, Python ... cheers, drlConfig::IniFiles - A module for reading .ini-style configuration files.
INI files consist of a number of sections, each preceded with the sec-
tion name in square brackets. INI files consist of a number of sections, each preceded with the sec-
tion name in square brackets. The first non-blank character of the
line indicating a section must be a left bracket and the last non-blank
character of a line indicating a section must be a right bracket. The
characters making up the section name can be any symbols at all. How-
ever section names must be unique.The first non-blank character of the
line indicating a section must be a left bracket and the last non-blank
character of a line indicating a section must be a right bracket. The
characters making up the section name can be any symbols at all. How-
ever section names must be unique.
-- excerpt form perldoc Config::IniFilesWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )


Reply With Quote