nmode-20.sl 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %
  3. % NMODE-20.SL - DEC-20 NMODE Stuff (intended for DEC-20 Version Only)
  4. %
  5. % Author: Jeffrey Soreff
  6. % Hewlett-Packard/CRC
  7. % Date: 24 January 1983
  8. % Revised: 25 January 1983
  9. %
  10. % 25-Jan-83 Alan Snyder
  11. % Add version of actualize-file-name that ensures that transiently-created
  12. % file has delete access.
  13. %
  14. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  15. (de current-date-time () % Stolen directly from Nancy Kendzierski
  16. % Date/time in appropriate format for the network mail header
  17. (let ((date-time (MkString 80)))
  18. (jsys1 date-time -1 #.(bits 5 7 10 12 13) 0 (const jsODTIM))
  19. (recopystringtonull date-time)))
  20. (de actualize-file-name (file-name)
  21. % If the specified file exists, return its "true" (and complete) name.
  22. % Otherwise, return the "true" name of the file that would be created if one
  23. % were to do so. (Unfortunately, we have no way to do this except by actually
  24. % creating the file and then deleting it!) Return NIL if the file cannot be
  25. % read or created.
  26. (let ((s (attempt-to-open-input file-name)))
  27. (cond ((not s)
  28. (setf s (attempt-to-open-output
  29. (string-concat file-name ";P777777") % so we can delete it!
  30. ))
  31. (when s
  32. (setf file-name (=> s file-name))
  33. (=> s close)
  34. (file-delete-and-expunge file-name)
  35. file-name
  36. )
  37. )
  38. (t
  39. (setf file-name (=> s file-name))
  40. (=> s close)
  41. file-name
  42. ))))