|
Posted by Rich Grise on April 2, 2008, 3:53 pm
Please log in for more thread options On Wed, 02 Apr 2008 04:07:42 +0000, xhoster wrote:
>> Apologies to Perl purists - comp.infosystems.www.authoring.cgi doesn't
>> work on my newsreader, and this is a CGI question:
>>
>> What I want to do is, I've got a large collection of image files:
>> $ wc gallery-pix
>> 37448 62619 3218967 gallery-pix
>>
>> and what I'd like to do is look at each of the 37488 image files on
>> some kind of page, with buttons like "Keep", "Skip", and "Quit",
>> so I can page through all of these images, which are strewn all
>> over the Samba server, and decide which ones might look good on
>> the website.
>>
>> So, is it possible to do something like (in pseudocode):
>>
>> for each $line in <file> {
>
> In CGI, your program won't survive for the loop to iterate. Unless
> you are making one page with all 37448 files on it.
>
>> show webpage with <img> tag, and the three buttons;
>> get button response, decide what to do with file;
>
> What would you do with the file in each case?
>
>> if button == "Quit", save place in source file;
>> next;
>
> Make one directory with all the files (or with a symbolic links for each
> file). Each time the program is invoked, take the first entry in the
> directory and display it. Based on the response, either move it to the
> accept directory or the reject directory (or move it to accept vs delete
> it, whatever.) Since the file is no longer there, place is inherently
> saved. Quit doesn't have to do anything, nor even have to exist--closing
> the browser without responding is a form of quiting.
Thanks - I really like this answer - I hadn't even consider loading up
a directory with symlinks.
I'm going to try this next, as a way to avoid slurping the whole file.
So, anybody got a quick and dirty script that will make 38,000 symlinks?
;-)
I'm not too worried about how long it will take - I'm doing this in
my "spare" time, and the boss doesn't bother me much as long as I look
busy. :-)
Thanks!
Rich
|