[comp.sys.apple] File types - Problem with downloads

maton@dvinci.USask.CA (Terry Maton) (06/21/89)

I have been having problems with file types now for some time.

When I download a EXEcable file and EXEC it, it makes a BIN type file
instead of a SYS type.

This means I cannot run it :-(

I know there is a file type changer program in the APPLE2-L archives, but
yes - Catch-22 - that file when downloaded and EXEC'd produces a BIN file!!!

HELP!!!



	Terry Maton
	University of Saskatchewan
	Saskatoon
	Saskatchewan
	Canada

uucp address:	maton@dvinci.USask.ca
bitnet address: MATON@SASK.BITNET

******* One Planet - One People - PLEASE *******

dlyons@Apple.COM (David Lyons) (06/22/89)

In article <2069@dvinci.USask.CA> maton@dvinci.USask.CA (Terry Maton) writes:
>I have been having problems with file types now for some time.
>
>When I download a EXEcable file and EXEC it, it makes a BIN type file
>instead of a SYS type.

Do you get any error messages?  If all goes well with the execution of an
Executioner-created EXEC file, you should get the proper file type.  Did
you check to see if the resulting BIN file is actuall packed in Binary II
or ShrinkIt format?

>This means I cannot run it :-(
>
>I know there is a file type changer program in the APPLE2-L archives, but
>yes - Catch-22 - that file when downloaded and EXEC'd produces a BIN file!!!

You don't *really* need a special filetype changer to get started--it just
makes the process simpler.  (I really wish everybody habitually used a
command shell that has a command for changing filetypes and auxtypes.)

Anyway, if you have a file that's *supposed* to be a SYS file but is a
BIN file instead, here's what you can do from BASIC.SYSTEM.  If you just
want to execute the thing,

   BLOAD myfile,A8192
   CALL 8192

If you want to change the type, create a new SYS file and save the contents
of the BIN file into it, like this:

   CREATE newfile,TSYS
   BLOAD oldfile,A8192
   BSAVE newfile,TSYS,A8192,Lxyz

where "xyz" is the "endfile" (the size) of the old file as shown by the
CATALOG command (*not* the CAT command).

 --Dave Lyons, Apple Computer, Inc.          |   DAL Systems
   AppleLink--Apple Edition: DAVE.LYONS      |   P.O. Box 875
   AppleLink--Personal Edition: Dave Lyons   |   Cupertino, CA 95015-0875
   GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
   Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons

   My opinions are my own, not Apple's.

brianw@microsoft.UUCP (Brian Willoughby) (06/24/89)

In article <2069@dvinci.USask.CA> maton@dvinci.USask.CA (Terry Maton) writes:
...
>When I download a EXEcable file and EXEC it, it makes a BIN type file
>instead of a SYS type.
>
>I know there is a file type changer program in the APPLE2-L archives, but
>yes - Catch-22 - that file when downloaded and EXEC'd produces a BIN file!!!
>
>	Terry Maton

What you need to do is create a new file of type SYS and copy the BIN file
to it.  In BASIC.SYSTEM you would first CATALOG the directory including
the incorrect BIN file and remember it's length.  Since SYS files always
load at address $2000, you should then BLOAD the BIN file at that address:

	BLOAD oldfile,A$2000

Then you should create the destination SYS file...

	CREATE newfile,TSYS

and save the BIN file memory image to the new name as a SYS file.

	BSAVE newfile,TSYS,A$2000,L<length>

The <length> is found (in decimal, as I remember) in the full CATALOG
display, but not in the shortened CAT command.  If you use the wrong
length then you'll lose part of the file in the conversion.  Of course,
this will only work with files that are short enough to load into memory,
but that should not affect this kind of file type change because SYS
files must be loaded into memory to execute.  For other kinds of file
type changes, try using a sector editor and the Apple ProDOS Reference
Manual list of file type byte codes.

Brian Willoughby                        ...!uw-beaver!microsoft!brianw
                or                      microsoft!brianw@uunet.UU.NET
                or just                 brianw@microsoft.UUCP

SEWALL@UCONNVM.BITNET (Murph Sewall) (06/25/89)

>When I download a EXEcable file and EXEC it, it makes a BIN type file
>instead of a SYS type.
>
>This means I cannot run it :-(

The usual cause of this problem is an Executioner file that has a 'pad'
character (or a blank or something) in the line before the BSAVE (the
BSAVE *must* be preceeded by 2 <cr's> with NO intervening characters).

If you EXEC and don't get the message "<programname> Saved" when the
EXEC completes, you might try

CALL -151
E00G

I haven't experienced the problem, so I haven't any experience with trying
to get the 'closer' routine to run by hand that way, but the code the
Executioner stores at E00 is a program to write the proper directory entry
for the file that was just BSAVE'd.

Murph Sewall                       Vaporware? ---> [Gary Larson returns 1/1/90]
Prof. of Marketing     Sewall@UConnVM.BITNET
Business School        sewall%uconnvm.bitnet@mitvma.mit.edu          [INTERNET]
U of Connecticut       {psuvax1 or mcvax }!UCONNVM.BITNET!SEWALL     [UUCP]
           (203) 486-5246 [FAX] (203) 486-2489 [PHONE] 41 49N 72 15W [ICBM]

-+- I don't speak for my employer, though I frequently wish that I could
            (subject to change without notice; void where prohibited)

MGRJTC@ROSEVC.Rose-Hulman.EDU ("Jerrod T. Carter, Asst. Manager") (06/25/89)

>>When I download a EXEcable file and EXEC it, it makes a BIN type file
>>instead of a SYS type.
>>
>>This means I cannot run it :-(
>
>If you EXEC and don't get the message "<programname> Saved" when the
>EXEC completes, you might try
>
>CALL -151
>E00G
>
I had this problem too, and this answer was just what I needed.  Worked great.