Good localtime friends,

I recently inherited a project at work that requires storing information about collections of images. Essentially each image that comes through has the following attributes:

1)Name of the collection it belongs to
2)Number of images in collection
3)Image number _ of _ in collection
4)File name of image

As these come in I need to store the information above until the final image of the collection is processed. I was thinking about creating a file (collectionname.dat) using a format like ...

Number of images => 5 1 => image1.jpg 2 => image2.jpg 4 => image4.jpg 5 => image5.jpg

So in the example above I have not received the third image of the collection.Each time I receive an image I have to perform the following:

1)Check for existence of dat file. Create one if required
2)lock the file (concurrency)
3)check to see if the latest image completes the collection
  3a)If not, write the image information to a file
  3b)If it does, send the collection out and delete my dat file

Now on to the question. Any ideas on suggestions to make this quicker and easier? Currently the use of a DB is not an option.

Cheers,
Hok


In reply to Caching Format by hok_si_la

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.