Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!adam From: adam@utcs.UUCP Newsgroups: comp.sys.cbm Subject: Re: Changing sequential files to program files Message-ID: <1987Jan27.210032.22608@utcs.uucp> Date: Tue, 27-Jan-87 21:00:32 EST Article-I.D.: utcs.1987Jan27.210032.22608 Posted: Tue Jan 27 21:00:32 1987 Date-Received: Tue, 27-Jan-87 22:31:52 EST References: <592@rayssd.RAY.COM> Reply-To: adam@utcs.UUCP (Adam Iles) Distribution: na Organization: University of Toronto Computing Services, general purpose UNIX Lines: 46 Keywords: SEQ -> PRG Checksum: 20139 In article <592@rayssd.RAY.COM> msf@rayssd.UUCP writes: >Does anyone out there know how I can convert a sequential file (which is how >my terminal program downloads) into a program file (so I can load and run it) >I've tried to look at Track 18/Block 1 etc, but can't seem to get the hang >of it. Thanks in advance! If you want to avoid using a disk editor (such as the one that comes with the FASTLOAD cartrige) you can simply copy the seq file into a prg file on the same disk. A basic program that will let you do this follows in this article, but it's being typed from the top of my head (so it'll probably have bugz :-) If you do want the faster way (using a disk editor) there are a few things about the directory blocks that will be helpfull. - The starting block is Track 18 Sector 1 (1541, 4040, 2031, ...) - The records that represent the files are 32 bytes long - the break down is as follows... BYTE DESCRIPTION 0-1 pointer to the next track/sector (1st file only) 2 File type (0 - Scratched files) (1 - SEQ files) Note: these values (2 - PRG files) are OR'ed with (3 - USR files) $80 when properly (4 - REL files) closed. 3-4 start of file Track/Sector 5-20 File name (padded with chr$(160)) . . . Therefor if you want to change the second file to a program file you will want to change byte 34 to $82 from $81. 0 rem "Adam R. Iles 870127 -- Bare bones seq to prg 10 open 1,8,8,"seq file,s,r": open 2,8,9,"prg file,p,w" 20 for s=0 to 1: get#1,a$: s=st: if a$="" then a$=z$ : rem when st>0 last byte 30 print#2,a$;:next 40 close 1: close 2 -- Any opinions stated above may, or may not, refect those of any sane person living, dead, or just sleeping. Adam R. Iles: ...{decvax,ihnp4,utcsri,{allegra,linus}!utzoo}!utcs!adam