Directory system in TR-DOS
ZXNet echo conference «code.zx»
From Stanislav Udin → To All 2 December 1999
Hello, All!
I will never believe that this idea came to my mind first. But for some reason
I have never heard of it anywhere, much less seen it implemented. People for a long time
uses three-letter extensions, but for some reason the directories are still not
implemented. It's so easy to do. I explain:
On track 0, only 9 sectors are used; the remaining 7 are not used in any way
(not taking into account Scorpio's shadow monitor, various commanders, bytes and
other programs that use this area for their own purposes). Quite logical
assume that they should be used for the subject. How to do this? Easily!!!
All files have their own serial number on the disk from 0 to 127. So what’s simpler?
use use free space for directory names indicating
serial numbers of the files in them, and use numbers from 128 to 255 as links
to continue the directory, subdirectories, etc.? Simple commanders and bytes
will see a regular TR-DOS disk, and a program that supports this mode
ywill see directories with files. In sector 9 you need to place one single
byte-identifier of this system; if it is not there, a simple floppy disk or with
dirty sectors after the 9th. Of course, the standard MOVE procedure will kill
complete sorting of files into directories, but the disk will remain completelyworkable, therefore for this purpose you need to use a program with
appropriate support. Here are the basic principles. Figure out the details yourself.
The main thing is that there is a SINGLE standard.
P.S. Personally, I intend to provide this kind of support in my program.
P.P.S. I wouldn’t be surprised if they boo me and say something like “Yes, I’ve done this for 10 years already.”
years ago I came up with it and implemented it..." This is approximately how they ALWAYS answer me
all my suggestions, after which I simply don’t want to do anything further.
Best regards, Stanislav
From Stanislav Udin → To Roman Chupak 9 December 1999
Hello, Roman!
03 Dec 99 13:57, Roman Chupak -> Stanislav Udin:
RC> But it’s an extremely cool thing! That's interesting -
You are apparently not of this world? Don't you see the PEOPLE don't like it? What the hell
cool thing? As many people ask, what is the practical meaning of this?
RC> there will be no incompatibility - in the root directory
RC> lies
RC> player, and the music zones are all in the MUSIC directory, and player,
RC> having booted up, you will be able to see the entire disk, as usual.
RC> And you know who should be offered to do this, but not offered,
RC> but just force (:-)) ? To the creator of REAL Commander - Pavly
RC> Kislyaky. I don’t remember, is it in ZX-Net?
SU>> P.S. Personally, I will provide such support in my program
SU>> intent.
RC> Which one? In some kind of store?
No, not really. I don’t write in more detail, because it’s still nothing good
I won’t hear any answer from the population.
For those who think that this idea is not bad, I’ll write more specifically (from correspondence
to netmail), everyone else, skip “this nonsense.”
In the simplest version, without any links and without nesting each other
directory system might look like this:
10 sector +00NAMEDIR1 8 bytes
#00
#01
#02 number of files in this directory
#03
#77
#78
10 sector +128
NAMEDIR2 8 bytes
#00
#01
#02
#03
#FF is a marker for the end of files in a directory
In this way, each sector can contain information about 2 directories in
which can contain up to 120 files, in total there can be 14 such directories (2*7
free sectors) without nesting directories into each other.
For the option with nested directories and a non-fixed number of files in
In directories, the information on disk can be arranged approximately like this.
10 sector + #00
NAMEDIR1 8 bytes
#00
#01 file numbers in the directory
#02
#FF end of directory
NAMEDIR2 8 bytes
#03
#04
#FE marker for unfinished catalog
#00 #80 shift indicator (how much you need to move it back from the beginning of the 10th sector)
to find the continuation of the catalog
NAMEDIR3 8 bytes
#05
#06
#FD marker of subdirectory
#00 #90 shift pointer where to look for subdirectory
#07 file numbers
#08
#FF end of files in directory
10 sector + #0080
#09
#0A
#0B file numbers
#FF end of directory (something like RET in assembler)
10 sector + #0090
NAMEDIR4 8 bytes - directory nested in directory NAMEDIR3
#0C
#0D
#FD marker of subdirectory
#00A0 where to look for a subdirectory
#FE directory is not complete (something like JP #01FE in assembler)
#01FE - where to look for it.
etc.
When scattering files on an already recorded disk, there are problems with creating a directoryno, but if directories are created as the disk is used and gradually
writing files to it, here the directory system will look like
permanent labels #FE #** #**, which is why for every new directory (even
if it contains one file), you need to allocate at least 11 bytes (8 bytes name + 3 bytes for
continuation link #FE #** #**), that is, first directories in which one
the files should look like this
NAMEDIR1
#00
#FF
#FF
NAMEDIR2
#01
#FF
#FF
etc. After adding files to these directories, #00 #FF #FF changes to #FE #** #**.
Of course, it is necessary to periodically optimize these sectors to reduce
gradually accumulating #FE #** #**. This, of course, can be done at all
every time you write a new file, then the #FE #** #** construction is not
will be needed at all.
An empty directory will look like: NAMEDIR1 #FF #FF #FF
Apparently you still have to add a marker for the beginning of the directory name, it can also
indicate the degree of nesting, and it’s also a good idea to make a link to the parent one
catalogue.
Best regards, Stanislav