[Coco] File size from Disk Basic

Bob Devries devries.bob at gmail.com
Thu Jun 28 18:43:20 EDT 2007


Hi, Bob.

The programme snippet I typed will use no extra memory at all. It will use 
the existing File Control Block memory which has already been allocated by 
Disk Basic.

The revised programme lines are:

10 OPEN"D",#1,"FILENAME.BIN",1
20 SIZE=LOF(1)
30 PRINT"FILE SIZE=";SIZE
40 CLOSE #1

You can of course modify that to give you the size in HEX if that is more 
useful.

BTW, the utility "Disk Util 2" by Jeff Francis (sp) also gives this 
information as well as a list of the granules used.

Hope it helps.
--
Regards, Bob Devries, Dalby, Queensland, Australia

Isaiah 50:4 The sovereign Lord has given me
the capacity to be his spokesman,
so that I know how to help the weary.

website: http://www.home.gil.com.au/~bdevasl
my blog: http://bdevries.invigorated.org/

----- Original Message ----- 
From: "theother_bob" <theother_bob at yahoo.com>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Thursday, June 28, 2007 11:06 PM
Subject: Re: [Coco] File size from Disk Basic


> That's cool, but if used as part of a large basic program, would it cause 
> an OM error?
> I'll have to play with it later, thanks Bob
>
> Bob
>
> ----- Original Message ----
> From: Bob Devries <devries.bob at gmail.com>
> To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
> Sent: Wednesday, June 27, 2007 5:55:20 PM
> Subject: Re: [Coco] File size from Disk Basic
>
>
> There is a much easier way to find file size.
>
> Use the LOF function!
>
> Opne the file like this:
>
> OPEN"D",#1,"FILENAME.BIN",1
> FIELD #1, 1 AS A$
> SIZE=LOF(1)
> PRINT"FILE SIZE=";SIZE
> CLOSE #1
>
>
>
> ____________________________________________________________________________________
> Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated 
> for today's economy) at Yahoo! Games.
> http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco 




More information about the Coco mailing list