/tmp files

stephen

Joined: 2002-11-20
Posts: 17
Posted: Wed, 2002-11-20 22:42

There are some files in my /tmp directory all called galleryXXXXXX, where the X is some number or letter. They are all zero bytes, but the problem is they don't seem to be deleting themselves, unlike the sess_******..... files which disappear eventually.

I guess my questions are what is the function of the galleryXXXXXX files? And if there are any ideas on why they aren't deleting themselves? I can do it by hand but that's not a satisfactory solution.

I am running Gallery 1.3.1.

Thanks!

 
rmmcclay

Joined: 2002-11-21
Posts: 4
Posted: Thu, 2002-11-21 18:21
Quote:
There are some files in my /tmp directory all called galleryXXXXXX, where the X is some number or letter. They are all zero bytes, but the problem is they don't seem to be deleting themselves, unlike the sess_******..... files which disappear eventually.

I guess my questions are what is the function of the galleryXXXXXX files? And if there are any ideas on why they aren't deleting themselves? I can do it by hand but that's not a satisfactory solution.

I am running Gallery 1.3.1.

Thanks!

Just to say that I discovered the same thing. There were around 11,000 galleryxxxx files in /tmp. All 0 length. I believe the problem is in save_photos.php...but I've yet to find a fix.

For the time being I just delete them after I upload photos...

Russ

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2002-11-21 21:30

Hi. I believe you've stumbled on a Gallery bug!!

Here's my hunch:

This only happens if you do one of the following:
-Upload a zip file via Browse
-Add links from a directory
The file is deleted if you do the following
-Upload an image/movie file via Browse

The thing is... the temp file holding the current image being processed only gets added to the "delete this temp file" list if move_upload_file() returns true. But this won't return true on the zip file images or for a local file. So those temp files never get deleted. Aha! Okay... I'm gonna go make a bug report. I'll keep you posted on the results.

-Beckett (beck@beckettmw.com)

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2002-11-21 22:08

(Posted <!-- BBCode Start --><A HREF="http://marc.theaimsgroup.com/?l=gallery-devel&amp;m=103791618125687&amp;w=2" TARGET="_blank">here</A><!-- BBCode End -->).

 
rmmcclay

Joined: 2002-11-21
Posts: 4
Posted: Fri, 2002-11-22 04:09
Quote:
Hi. I believe you've stumbled on a Gallery bug!!

Here's my hunch:

This only happens if you do one of the following:
-Upload a zip file via Browse
-Add links from a directory
The file is deleted if you do the following
-Upload an image/movie file via Browse

The thing is... the temp file holding the current image being processed only gets added to the "delete this temp file" list if move_upload_file() returns true. But this won't return true on the zip file images or for a local file. So those temp files never get deleted. Aha! Okay... I'm gonna go make a bug report. I'll keep you posted on the results.

-Beckett (beck@beckettmw.com)

Thanks Beckett for the quick reply on this. I have implemented a simple workaround (on a Linux box) until the real fix comes along.

In the file: save_photos.php

I added this line:

system('rm /tmp/gallery*');

right before this (around line 357):

if ($temp_files) {
/* Clean up the temporary url file */
foreach ($temp_files as $tf => $junk) {
fs_unlink($tf);
}

Russ

 
stephen

Joined: 2002-11-20
Posts: 17
Posted: Fri, 2002-11-22 17:50

Thanks Russ and Beckett for your help!

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Sat, 2002-11-23 03:17

Fixed! Grab 1.3.2-cvs-b32 or wait till ~Monday and get the official 1.3.2.
Thanks for the heads up!

 
rmmcclay

Joined: 2002-11-21
Posts: 4
Posted: Sat, 2002-11-23 05:23
Quote:
Fixed! Grab 1.3.2-cvs-b32 or wait till ~Monday and get the official 1.3.2.
Thanks for the heads up!

Thanks for the extremely fast fix! I've tested out the amended
code and no more lingering temp files after zip or directory uploads.

Excellent!

Russ