News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_ervin

a question about disk files

Started by ervin, 01:03, 30 January 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ervin

Hi everyone.

I have a little question about how AMSDOS stores files on disk.

My program will ultimately need around 250 files stored on one side of a disk.
Is this actually possible (even if all the files are less than 1K in size)?

Or will each file take up a 1K block on disk, thereby limiting the number of files to 178 or thereabouts?

Thanks.


ervin

I think I've found the answer.

In Soft 968 Section 9 it says:

Common To All Formats
Single sided (the two sides of a 3 inch disc are treated separately).
512 byte physical sector size.
40 track numbered 0 to 39.
1024 byte CP/M block size.
64 directory entries.

Does this mean 64 files maximum?
If so, I've got some interesting/tricky problems to solve...


Johnny Olsen

Yes it does.
Track 0  sector c1-c4 contains the file names max.64

ervin

#3
Quote from: Johnny Olsen on 01:47, 30 January 15
Yes it does.
Track 0  sector c1-c4 contains the file names max.64

Ah, ok.
Thanks Johnny.

Looks like I'll have to have exomized files within exomized files in order to get everything on the disk!
So I'll need some sort of indexing system so that my program knows which EXO file contains which EXO sub-files...  :o

Mochilote

You may use one non-standard cpc disk format like PARADOS or ROMDOS with 128 or 256 disk entries. Or maybe you can try to write/read disk sectors manually to store/load your data directly.


Cheers,


Mochilote.

ervin

Thanks for the suggestions Mochilote. [emoji4]

TFM

Well a Data Disc provides 178 KB free space, this is 356 sectors of 512 bytes each.

So you could easily work with up to 356 single files; each 512 bytes in length.

All DOS do provide commands for reading or writing sectors, so this should be doable. If you need help, then PM me  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod