Forum OpenACS Q&A: photo album delete

Collapse
Posted by Cristian Petrescu-Prahova on
Hello,

I am trying to figure out what happens when I delete a photo from a photo album. The UI claims the deleting is irreversible, however I could not find any relevant 'file delete' anywhere in either the photo album or the content repository soure tree (comments in the photo album code seem to indicate the file-system delete is the CR responsability).

I also have noticed that the size of the content-repository-content-files has doubled when I deleted a badly imported batch of photos and then reloaded them. I did this because the photo-album code did not use sorting and just uploaded photos in a seemingly random order (plain glob).

At this point I'm suspecting (hoping) that there is some sort of a CR daemon that cleans up unneeded CR files from the file-system, however I could not identify it. Any hints on where the file-system (photo) delete could be? Or at least how to manage file-deletion for CR items that use FS storage?

If there is no way do actually delete files from the CR, any suggestions how/where to add such code? Especially taking in account (transactional) consistency between the DB CR part and the associated FS files.

I'm running OpenACS 5.1.5 on Fedora 4.

Thank you,
Cristian

Collapse
2: Re: photo album delete (response to 1)
Posted by Dave Bauer on
There is a scheduled procedure that deletes the files once a day when the associated content item is deleted in the database.
Collapse
3: Re: photo album delete (response to 1)
Posted by Cristian Petrescu-Prahova on
Thanks for the answer.

I finally discovered the cr_delete_scheduled_files scheduled TCL proc, relying on the SQL table cr_files_to_delete, which seems to solve my problem, given I have enough patience to wait 24 hours.

Collapse
4: Re: photo album delete (response to 1)
Posted by Cristian Petrescu-Prahova on
One more question: how do I get the file system name where the content of a photo is stored? I tryed "content::item::get_path", but that gives something like "/photo-album_492/test/album_test/548:IMG_0644.JPG", whereas I'm looking for something like "42/11/4112"

Thank you,
Cristian

Collapse
5: Re: photo album delete (response to 1)
Posted by Dave Bauer on
To get the path to the file you use cr_items.content on postgresql and cr_items.filename on Oracle.

In most cases you can use cr_write_content to deliver the content file without worrying about where it is stored.