Data storage
Posted: Wed Feb 12, 2014 2:00 pm
I've written a little program for a school that runs on their network.
I've done the following to store data: I create / edit a file on a network share called lessons.txt that looks like this:
lesson name a*1
lesson name b*2
lesson name c*3
The * is the delimiter and the numbers in the second columns is the filename - in other words lessons.txt is in /sharename and in /sharename/lessons is file 1, 2, 3 etc. When a new lesson is created, I look for the highest valued filename and then just add 1 to it to create the new lesson, when a lesson is deleted, I simply remove the line of the lesson from lessons.txt and delete the file 2 for example, then I just have file 1,3 and 2 is never used again (I'm sure filenames can go into billions?)
I'm adding users now and I'm just wondering if there is a better way to store the data, without using sql? ie. something similar that what I have explained here.
Remember that many computers will read from the network, although only the teacher will create lessons, etc. That is until I get to storing reports as well when a student complete a lesson (file access problems?)
Thanks,
Carel
I've done the following to store data: I create / edit a file on a network share called lessons.txt that looks like this:
lesson name a*1
lesson name b*2
lesson name c*3
The * is the delimiter and the numbers in the second columns is the filename - in other words lessons.txt is in /sharename and in /sharename/lessons is file 1, 2, 3 etc. When a new lesson is created, I look for the highest valued filename and then just add 1 to it to create the new lesson, when a lesson is deleted, I simply remove the line of the lesson from lessons.txt and delete the file 2 for example, then I just have file 1,3 and 2 is never used again (I'm sure filenames can go into billions?)
I'm adding users now and I'm just wondering if there is a better way to store the data, without using sql? ie. something similar that what I have explained here.
Remember that many computers will read from the network, although only the teacher will create lessons, etc. That is until I get to storing reports as well when a student complete a lesson (file access problems?)
Thanks,
Carel