December 2, 2011

pratik041 pratik041
Lab Rat
346 posts

Is their any limitation in using INI file for crossplatform application in Qsetting class?

 

Like limitation in file size or portability.

 Signature 

Pratik Agrawal

6 replies

December 2, 2011

Volker Volker
Robot Herder
5428 posts

No, theres is no limit, as the code for reading/writing .ini files is the same on all platforms. Size is only restricted by the maximum file size supported by the filesystem in use, but if you run into that limit, you should seriously consider another design for storing the data :-)

December 2, 2011

pratik041 pratik041
Lab Rat
346 posts

Volker wrote:
No, theres is no limit, as the code for reading/writing .ini files is the same on all platforms. Size is only restricted by the maximum file size supported by the filesystem in use, but if you run into that limit, you should seriously consider another design for storing the data :-)

“filesystem in use” means how can we know what is the limit of that file?

 Signature 

Pratik Agrawal

December 2, 2011

Volker Volker
Robot Herder
5428 posts

If you run into the limits of a file system, which is usually 2GB or more, you should seriously consider using another storage engine for your data instead of QSettings.

To know the limits, use Google and search for ext2, ext3, ext4, fat, ntfs, hfs+ or whatever file system you’re using.

December 2, 2011

pratik041 pratik041
Lab Rat
346 posts

Volker wrote:
If you run into the limits of a file system, which is usually 2GB or more, you should seriously consider using another storage engine for your data instead of QSettings.

To know the limits, use Google and search for ext2, ext3, ext4, fat, ntfs, hfs+ or whatever file system you’re using.


oh but i think that much it will never reached.

 Signature 

Pratik Agrawal

December 3, 2011

veeeee_d veeeee_d
Lab Rat
56 posts

Volker was just kidding. The current file systems accept really large files. He meant that a .ini file is a regular file like any other, and you can use it so that Qt will store your data in a regular fashion across platforms and you won’t suffer any consequence.
More precisely, he answered your initial question with a “no”.

December 3, 2011

fluca1978 fluca1978
Ant Farmer
524 posts

By the way, if you will hit some limit (maybe an embedded device) you can store in a ini file names or paths to reach and load other specific ini files. But as stated in this thread, you will never hit the ini file size unles you use it in an improper way (e.g., storing large strings as user data).

 
  ‹‹ QRegExp not supporting \n back-references in Lookaheads?      Qt4.6.2 crashing after ’simpleShaderProg’ fails to compile over ssh ››

You must log in to post a reply. Not a member yet? Register here!