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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|