How should I store data? Database? Text files? Something else entirely?
Hi all,
Strange question I guess. I'm going to be storing lots of paths to lots of files with some info about the file type, and I want this data to be stored locally. Should I do this in a database, XML maybe, or is there some other storage medium I'm missing? If I should use a database, with what should I create it?
Example:
File1 Path: "C:\..."
File1 Type "material"
File1 SetID "2"
Repeat for File2, etc.
I know it's silly, but I've never had to store more than a bit of data, and in the past I just wrote it to a text file and parsed it back in later. It would seem I've reached the end of that solution's utility.
Thank you for your time,
Backslash
Re: How should I store data? Database? Text files? Something else entirely?
How many filenames are you planning to store? Because your textfile way seems ok to me, unless you're talking about a massive amount of data.
Of course, you could switch to an XML format, to make it more portable. I do like XML. But to be fair, the file would take even more space because of all the markup.
Re: How should I store data? Database? Text files? Something else entirely?
Is the problem in size of that file or access time?
Re: How should I store data? Database? Text files? Something else entirely?
I'm just looking for a solution that will be easy enough to search through. Like if I want to find all the files that belong to set 2. I could just do it line by line in text I guess. Just wondering if there's a better way. :)
In that same direction, how do the big programs do it? (When they have to store a bunch of preferences for instance, or references to a large number of files.)
Thanks for the quick replies,
Backslash
Re: How should I store data? Database? Text files? Something else entirely?
This sort of thing is generally handled through text files. You should just stick with that. XML is a nice way to do it.
In theory it depends on what you mean by "a large number", but I don't think you are likely to cross that boundary.
Re: How should I store data? Database? Text files? Something else entirely?
Sounds good. I really appreciate the quick answers.
Much thanks,
Backslash