Re: Grabbing last file...
| From: | Curt Zirzow | Date: | Tue, 06 Jul 2004 06:50:56 +0000 |
| Subject: | Re: Grabbing last file... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189768@lists.php.net to get a copy of this message | ||
* Thus wrote Ashley M. Kirchner:
>
> I have a capture script that runs every 2 minutes and dumps an image
> into a folder. I'm trying to write a script (which will get included in
> another) that will grab the last image in the folder and pass it on.
>
> The images are saved as 'capture.####.jpg' where #### is the
> timestamp of the capture , starting at midnight, or 0000, and going till
> 2358. The structure of the folder is as follows:
>
> /capture/.year/month/day/capture.####.jpg
>
>...
>
> And all it has to do is figure out the last file, generate an
> <img...> tag and return it. Voila.
have your image generation script do somthing like this:
1. generate new image /capture/.year/month/day/capture.#.jpg
2. copy /capture/.year/month/day/capture.#.jpg /capture/current.jpg
That way you can simply put in your img tag:
<img src="/capture/current.jpg">
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!