+ unless (-d $self->threaddir($param)) {
+ mkdir $self->threaddir($param), 0777 or return;
+ }
+ my $filename = $self->cachefile($param);
+
+ unless (write_lock_file ($filename)) {
+ violent_unlock_file ($filename);
+ $self->set_error ('could not write-lock cache file '.$filename);
+ }
+ else {
+ local *CACHE;
+ unless (sysopen (CACHE, $filename, O_APPEND | O_CREAT | O_RDWR)) {
+ $self->set_error ('could not open to read/write/append cache file '.$filename);
+ }
+ else {
+ $status = $gosub -> (
+ $self,
+ \*S,
+ \*CACHE,
+ $param
+ );
+ unless (close CACHE) {
+ $status=0;
+ $self->set_error('could not close cache file '.$filename);
+ }
+ }
+ violent_unlock_file ($filename) unless (write_unlock_file ($filename));
+ }
+ unless (close S) {