fixed512.com 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. $! v = 'f$verify(0)'
  2. $!
  3. $! FIXED512.COM: Uses the FILE utility or SET FILE/ATTR
  4. $! to convert binary stream_LF file headers
  5. $! to FIXED 512.
  6. $!
  7. $! Author: F.Macrides (macrides@sci.wfeb.edu)
  8. $!
  9. $! Usage: @Lynx_Dir:FIXED512 <stream_LF file that's actually binary>
  10. $!
  11. $! Lynx performs the conversion via internal code if the file is
  12. $! recognized as binary. This command procedure can be used externally
  13. $! if that detection failed, e.g., for binary files downloaded from FTP
  14. $! servers with extensions that hadn't been mapped to a binary MIME
  15. $! type in the Lynx configuration files.
  16. $!
  17. $!===========================================================================
  18. $!
  19. $! Get and build Joe Meadow's FILE utility for VAX and AXP:
  20. $! ftp://ftp.wku.edu/vms/fileserv/file.zip
  21. $! and define it here, or system-wide, as a foreign command.
  22. $!
  23. $! FILE := $device:[directory]FILE.EXE
  24. $!-----------------------------------------------------------
  25. $!
  26. $! Just exit and leave the file stream_LF if we didn't get
  27. $! the filename as P1, or if it's not a valid file spec.
  28. $!
  29. $ IF P1 .EQS. "" THEN EXIT
  30. $ IF F$SEARCH(P1) .EQS. "" THEN EXIT
  31. $!-----------------------------------------------------------
  32. $!
  33. $! If we have FILE installed, use it.
  34. $!
  35. $ If f$type(FILE) .eqs. "STRING"
  36. $ Then
  37. $ FILE 'P1'-
  38. /TYPE=FIXED -
  39. /ATTRIBUTES=NOIMPLIEDCC -
  40. /CHARACTERISTICS=BEST_TRY_CONTIGUOUS -
  41. /RECORD_SIZE=512 -
  42. /MAXIMUM_RECORD_SIZE=512
  43. $ EXIT
  44. $ EndIf
  45. $!-----------------------------------------------------------
  46. $!
  47. $! If we get to here, and we're VMS v6+,
  48. $! we'll use SET FILE/ATTR to do it.
  49. $!
  50. $ If f$extract(1,1,f$getsyi("VERSION")) .ge. 6
  51. $ Then
  52. $ SET FILE/ATTR=(RFM:FIX,LRL:512,MRS:512,RAT:NONE) 'P1'
  53. $ EndIf
  54. $ EXIT