Re: PDF Workflow scripts: /private/tmp/
Re: PDF Workflow scripts: /private/tmp/
- Subject: Re: PDF Workflow scripts: /private/tmp/
- From: John W Baxter <email@hidden>
- Date: Thu, 20 Feb 2003 21:35:49 -0800
- Envelope-to: email@hidden
At 22:59 -0500 2/20/2003, Rob Jorgensen wrote:
>
Regarding the new PDF workflow feature introduced in OS X 10.2.4...
>
>
When a script is chosen from the print dialog, a new folder is
>
created in /private/tmp/ for each PDF file. Does OS X purge this
>
folder automatically or is it up to the scripter to delete or
>
otherwise deal with the newly created folder when the script is
>
finished?
If you (or your users...I'll just say "you") are allowing the daily cron
task to run, the leftovers will be removed after 3 days by this stanza in
/etc/daily (or /private/etc/daily, if you prefer to think of it that way):
if [ -d /tmp ]; then
cd /tmp && {
find . -fstype local -type f -atime +3 -ctime +3 -exec rm -f -- {} \;
find -fstype local -d . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \
>/dev/null 2>&1; }
fi
(If /tmp is a directory then change directories to /tmp and if that was
possible then find and delete files whose last access or last change time
is at least 3 days ago [and find and nuke directories whose modification
date is at least 1 day ago]). Since the find for the files descends into
directories, the directories are empty when rmdir tries to empty them.
({} in this context stands for "the path to the thing just found", and \;
is there because it has to be there by -exec's rules...the \ protects the ;
from the shell...I usually write '{}' and ';' instead of the above.))
Oh...and the definition of n days ago is a bit strange (round the time
difference UP to the next 24 hour point then deal with days).
Note: change time in Unix is the time of the last change in the file's
(directories are files) inode; modification time (used for the directory
portion) is the time of the change in the content (the last write of
content, whether it actually was a change or not). If I do chmod upon a
file, for example, I've changed the change time but not the modification
time of the file, but I've changed the modification time of the directory
containing the file but not the directory's change time. How well Apple
makes this all work with the virtual inodes that "track" what HFS+ is doing
I am not sure.
Or, you could clean up in the script. ;-)
--
John W. Baxter Port Ludlow, WA USA
Why does the computer industry speak of "input/output"? Depending on
viewpoint, it should be either intake/output or input/outtake.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.