File: fixed512.com

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