in reply to Caching Format
If I'm understanding you correctly, you could do away with the extra file (and the need for locking) by putting the info in the filenames themselves. For example
CollectionID_IDX_N_imgname.jpg
where CollectionID is a unique collection identifier, N is the expected total number of images, and IDX the image number within the collection (the collection ID could also be a directory). All you then have to do after having received a new image is a simple glob plus a check for completeness.
Update: forgot to mention that to avoid potential concurrency issues (reading yet incompletely written files), you'd rename a file to its final name only after you've finished writing it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Caching Format
by RichardK (Parson) on Jan 12, 2012 at 12:05 UTC | |
by hok_si_la (Curate) on Jan 13, 2012 at 23:15 UTC |