Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to add icon previews and retain time stamps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to add icon previews and retain time stamps
Authored by: lar3ry on Sep 25, '07 10:24:21AM
Add the following at line 3 (following the "##" line):
trap "rm -f /tmp/$UID.thumbnail-reference.tmp; exit" 0 1 2 3 15
This will remove the temporary file that this script creates when it exits.

A cleaner design would have this inlined into the code (remove the file before creating the reference stamp, and remove it once the file's time is reset) but "trap" is usually pretty good for quick and dirty cleanup.

[ Reply to This | # ]