Load files and strings
Sections, the global section, three comment styles, inline comments, values on several lines, a custom separator, Windows line endings.
Read, edit and write INI configuration files from modern Fortran, with typed values and no surprises.
ini, a command line tool of about 50 lines built on FiNeR (docs/examples/src/tour.f90), lists the sections of a file, reads a value, changes it and saves the file:
call case_file%load(filename='heat.ini', error=error)
if (error /= 0) then
print '(A,I0)', 'cannot read heat.ini, error ', error
stop 1
endifcall case_file%get(section_name='grid', option_name='cells', val=cells)
call case_file%get(section_name='grid', option_name='length', val=length)
call case_file%get(section_name='time', option_name='dt', val=dt)
call case_file%get(section_name='time', option_name='steps', val=steps)
call case_file%get(section_name='time', option_name='adaptive', val=adaptive)
call case_file%get(section_name='material', option_name='conductivity', val=conductivity)
call case_file%get(section_name='', option_name='title', val=title)The tutorial builds a complete program from here, chapter by chapter; the cookbook has a recipe for each everyday task.