readIniFile: Read and write an .ini file

Description Usage Arguments Details Value

View source: R/readIniFile.R

Description

These function read and write the content of an .ini file and converts to a list.

Usage

1
2
3
readIniFile(file, stringsAsFactors = FALSE)

writeIniFile(x, file, overwrite = FALSE)

Arguments

file

file path

stringsAsFactors

Should string values treated as factors?

x

Named list (see details).

overwrite

Should the function overwrite the file if it already exists.

Details

A .ini file has the following structure:

1
2
3
4
5
6
[section1]
key1 = value1
key2 = value2
[section2]
key3 = value3
...

readIniFile converts it to a list with the following format:

1
2
3
4
5
list(
  section1 = list(key1 = value1, key2 = value2),
  section2 = list(key3 = value3),
  ...
)

writeIniFile do the opposite operation.

Value

A list with an element for each section of the .ini file.


rte-antares-rpackage/antaresDev documentation built on May 17, 2019, 5:53 p.m.