[Coco] Curious DECB File o bytes

William Astle lost at l-w.ca
Sat Sep 8 23:23:56 EDT 2012


I don't believe the granule size is Luis's confusion. Instead, his 
confusion is that a file with no data in it still uses a granule. This 
is, in fact, correct behaviour. The reason is as follows:

In each directory entry, one of the bits of data is the first granule 
number. This is not an ordinary number in the granule chain. It must 
always point to a granule.

Thus, there is always at least one granule allocated. Now, this is 
actually quite logical because normally one creates files to actually 
hold data. Thus, it is logical to allocate at least some space for the 
file when it is created. Doing so also makes the code for handling the 
disk files simpler too.

It does seem logical that an empty file would use no space other than a 
directory entry, and that is the case with many file system. However, 
the DECB file system is not one that works that way.

On 12-09-08 07:08 PM, Bill Pierce wrote:
>
> I think I'm right in saying, when you create a new file in Disk Basic, HDBDOS, or RGBDOS, 1 granule is allocated to the file. So your test on an empty disk would allocate 1 gran but no bytes written yet.
>
> OPEN "O", # 1, "TEST"
> CLOSE
> TEST uses 1 granule zero bytes
>
>   Disk Basic writes to disk in 1 granule segments (9x 256 byte sectors). A waste of disk space but, it was what we had at the time. OS-9 gave us some relief with 1 sector writes. It gave us more file space.
>
> Music from the Tandy/Radio Shack Color Computer 2 & 3
> https://sites.google.com/site/dabarnstudio/
> Bill Pierce
> ooogalapasooo at aol.com
>
>
>
>
> -----Original Message-----
> From: Luis Fernández <luis46coco at hotmail.com>
> To: COCO <coco at maltedmedia.com>
> Sent: Sat, Sep 8, 2012 7:57 pm
> Subject: [Coco] Curious DECB File o bytes
>
>
>
>   "O", # 1, "TEST"
> CLOSE
> TEST uses 1 granule zero bytes
>
>
> You should not use granules
>
> ---------------------------------------------------------------------------------
>
> Making
> CoCoDskUtilPack V 1.1.3A.zip, Scan magazines and organize maltedmedia
> http://cococoding.com/cocodskutil/ Thank Aaron Wolfe
> http://www.tandycoco.com Thank Brian Blake and Stephen Fischer
> My personal blog: http://www.luis45ccs.blogspot.com,
> Excuse my English, I use google translator, my language is Spanish, I'm Spanish
> but I live in Venezuela
> --------------------------------------------------------------------------------- 		 	   		
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>




More information about the Coco mailing list