Next: , Previous: , Up: posix pid-files   [Index]

4.29.2 Library configuration parameters

The following bindings are exported by the library (vicare posix pid-files).

Parameter: pid-pathname

Hold #f or a string representing the PID file absolute pathname; beware of setting a relative pathname and then changing the current process directory. When set to #f: no PID file is created. It is initialised to #f.

Parameter: file-existence-procedure

Hold a function that tests PID file existence. It is initialised to file-exists?.

Parameter: textual-contents-reading-procedure

Hold a function that reads the PID file contents and returns them as a Scheme string. It is initialised to:

(lambda (pid-pathname)
  (with-input-from-file pid-pathname
    (lambda ()
      ;;A valid PID file does not contain a lot of
      ;;characters; let's say 32 at most.
      (get-string-n (current-input-port) 32))))
Parameter: textual-contents-writing-procedure

Hold a function that writes the PID file. It is initialised to:

(lambda (pid-pathname contents)
  (with-output-to-file pid-pathname
    (lambda ()
      (display contents))))
Parameter: file-removal-procedure

Hold a function that removes the PID file. It is initialised to delete-file.

Parameter: log-procedure

Hold a function accepting format–like arguments and logging the result:

((log-procedure) ?template-string ?arg ...)

If set to #f: logging is disabled. It is initialised to #f.