[Coco] File size from Disk Basic

William Astle lost at l-w.ca
Wed Jun 27 21:21:02 EDT 2007


Diego Barizo wrote:
> Very very close.
> Thanks a lot
> 
> OPEN"D",#1,"FILENAME.BIN",1
> INPUT #1, A$
> SIZE=LOF(1)
> PRINT"FILE SIZE=";SIZE
> CLOSE #1

Bob's code should also work. In fact, I don't think you need either the
INPUT or the FIELD statement since the ",1" on the OPEN statement tells
DECB how big the records are.

* flipping through Disk Basic Unravelled... *

Yup, all the info used by LOF is set up by OPEN so neither the FIELD nor
the INPUT is required.

> 
> 
> Bob Devries wrote:
>> 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
>>
>> But PLEASE check the above code in your manual. I just got out of bed,
>> and typed it off the top of my head.


-- 
William Astle
finger lost at l-w.ca for further information

Geek Code V3.12: GCS/M/S d- s+:+ !a C++ UL++++$ P++ L+++ !E W++ !N w---
!D !M PS PE V-- Y+ PGP t+@ 5++ X !R tv+@ b+++@ !DI D? G e++ h+ y?



More information about the Coco mailing list