Schrijver
| filenames
|
norakomi msx professional Berichten: 861 | Geplaatst: 14 Augustus 2006, 18:01   |
I just was wondering,
how come I can make a 1byte file, and still this file can have a filename of 11 characters?
If I make a 1 byte file and open it with a hex-editor the file-name isnt stored anywhere.
How does that work ?
|
|
Sd-Snatcher msx freak Berichten: 250 | Geplaatst: 14 Augustus 2006, 18:12   |
|
|
PingPong msx professional Berichten: 991 | Geplaatst: 14 Augustus 2006, 19:55   |
Quote:
| I just was wondering,
how come I can make a 1byte file, and still this file can have a filename of 11 characters?
If I make a 1 byte file and open it with a hex-editor the file-name isnt stored anywhere.
How does that work ?
|
Norakomi, it's logical that file name should be stored in other location. Otherwise if the name stored in the same physical file, this will be not easily readable in different platforms.
The file only had it's content. The name you assign is another story.
 |
|
manuel msx guru Berichten: 3451 | Geplaatst: 14 Augustus 2006, 20:03   |
norakomi: data about files isn't stored int he files themselves in hardly any file system. So, the file date and time are in somewhere in the FAT as well. Both are in the 'directory' sectors. Try the program "DiskView 2" on your MSX and look around a bit. Quite useful!
|
|
[D-Tail]
 msx guru Berichten: 3018 | Geplaatst: 14 Augustus 2006, 20:46   |
But ehh... don't try too much or you'll end up corrupting disks (as in, don't do what I used to do, never insert development disks when trying DV2  ) |
|
manuel msx guru Berichten: 3451 | Geplaatst: 14 Augustus 2006, 23:10   |
Or don't use the editing functions?  Better be safe than sorry, though, indeed! |
|
norakomi msx professional Berichten: 861 | Geplaatst: 15 Augustus 2006, 08:55   |
Boot
sector More reserved
sectors
(optional) File
Allocation
Table #1 File
Allocation
Table #2 Root
Directory
(FAT12/16 only) Data Region (for files and directories) ...
(To end of partition or disk)
very interesting. This is the main disk structure.
why are there 2 file allocation tables? and what does the root directory do?
Can use diskview 2 also to play around in the boot sector ?
And another thing:
About dos.
Is there part of dos already in the msx, because when I load dos from disk, it seems that the files command.com and MSXDOS.SYS are too small to have the whole operating system "in them" ?
|
|
PingPong msx professional Berichten: 991 | Geplaatst: 15 Augustus 2006, 09:02   |
Quote:
| Boot
sector More reserved
sectors
(optional) File
Allocation
Table #1 File
Allocation
Table #2 Root
Directory
(FAT12/16 only) Data Region (for files and directories) ...
(To end of partition or disk)
very interesting. This is the main disk structure.
why are there 2 file allocation tables?
|
Only for safeguard purposes. Because disk operations are not atomic there is the chance that while writing some data in a file, in the mean time you close it the fat update operation is interrupted by a failure (power off the computer!). The two FAT help the system to detect/correct similar situations . |
|
[D-Tail]
 msx guru Berichten: 3018 | Geplaatst: 15 Augustus 2006, 09:05   |
1 FAT is for backup. When updating a disk, both FATs are updated and when a FAT corrupts it's easy to fix. The root directory contains a record of all the files in the root directory of a disk (quite a 'duh'-explanation  )... Subdirs are stored like files, but their actual content is a new couple of 'directory' sectors. You can use DV2 also to edit the boot sector. Which is unwise, except for the product name in the first page. It's sort of indicating on what system that floppy was formatted, and you can edit it. Furthermore it contains data like the media descriptor (what kind of disk it is, double sided, single sided, high density, double density, etc...). |
|
ro msx guru Berichten: 2329 | Geplaatst: 15 Augustus 2006, 09:09   |
Furthermore, your file may be 1B but on disk it'll be one cluster big (on Fat12 that's 1K, disksize) (one cluster is 2 sectors of 512bytes)
The DIRECTORY sectors will store filename and attribs AND a pointer to the FAT entry. The FAT is an index for files, which will point to clusters of sectors which the file uses to store it's data. (well FAT doesn't actually point out to clusters but just to the next FAT entry, but just go with it for now).
So, forget it and keep on coding  |
|
norakomi msx professional Berichten: 861 | Geplaatst: 15 Augustus 2006, 12:53   |
Quote:
| So, forget it and keep on coding 
|
hahahaha |
|
manuel msx guru Berichten: 3451 | Geplaatst: 15 Augustus 2006, 18:48   |
The boot sector also contains the boot code to start e.g. MSX-DOS.
|
|
|
|
|