Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > File order on disk
2009-05-11 10:18
Mix256
Account closed

Registered: Dec 2008
Posts: 26
File order on disk

Hiya!

So, I got an app that removes and creates a file to disk (using kernal, $ffd8).
But where on the disk this file is listed afterwards seems totally random. Is it just me or is it like that?
In vice is seems to keep the position where it was. In ccs it jumps up and down. And the times I've tried it on real hw (/w 1541) it appears at the top.

The problem is that I want the main-app to appear at the top so a load"*",8,1 always loads it, and never this created file.

Any docs anywhere on this?

Thanks!
-mikael
2009-05-11 10:27
Steppe

Registered: Jan 2002
Posts: 1510
You can use a tool like Dir Master V8.4 to move dir entries up and down as you like. Can't help you with your original question, though.
2009-05-11 10:34
Mix256
Account closed

Registered: Dec 2008
Posts: 26
You said something there, 'dirs', that kind of solved my problem. Didn't it? If the disk can hold directories, ofcourse. Which it can, can't it?
Needs instant investigation. Thanks!

EDIT: Don't know what I was on about. Never seen a directory on a floppy. You can't create one, can you?
2009-05-11 10:58
Marauder/GSS
Account closed

Registered: Jul 2006
Posts: 224
AFAIR it always takes the first free directory-entry it finds to save the filename in a dir-sector.
So if you've f.e. 10 files on the disk and delete the 2nd one, then this "deleted" entry is taken for the next file you save (as it's deleted and hence a free directory-entry) and it's not saved on last position as you might assume... that's why it might seems randomly to you. Haven't tested how emulators do it...

1581 drives can also hold directories, on C128 but C64 doesn't have directories...
2009-05-11 11:12
Mix256
Account closed

Registered: Dec 2008
Posts: 26
Thanks Marauder. Sounds logical. Will do some more testing on real hw and hope you're right because then it would work as I want.
2009-05-11 14:33
Mace

Registered: May 2002
Posts: 1799
If you validate a disk, the directory is 'compressed'.
All empty entries are removed, the next time you save a file, it will be last on the disk.

However, if you have a disk with data saved without using a file entry (so called 'block loaders', 'track loaders' or a demo refered to as 'trackmo'), with verify you'll fuck things up :-)

Oh, yeah, to validate:
open 15,8,15,"V":close 15
2009-05-11 15:32
MagerValp

Registered: Dec 2001
Posts: 1078
Of course the 1541 has a directory, it just doesn't have *sub*directories...
2009-05-11 17:18
tlr

Registered: Sep 2003
Posts: 1790
Quote: Hiya!

So, I got an app that removes and creates a file to disk (using kernal, $ffd8).
But where on the disk this file is listed afterwards seems totally random. Is it just me or is it like that?
In vice is seems to keep the position where it was. In ccs it jumps up and down. And the times I've tried it on real hw (/w 1541) it appears at the top.

The problem is that I want the main-app to appear at the top so a load"*",8,1 always loads it, and never this created file.

Any docs anywhere on this?

Thanks!
-mikael


You can pre-create an entry at the top to delete and rewrite.
Otherwise you'll need to manipulate the directory track directly.
2009-05-11 18:22
Marauder/GSS
Account closed

Registered: Jul 2006
Posts: 224
Quote: Of course the 1541 has a directory, it just doesn't have *sub*directories...


yes, that's what I've ment when talking about directory-entries...ofcoz it has a directory, but not subdirectories!
2009-05-12 17:23
AlexC

Registered: Jan 2008
Posts: 299
Quote: yes, that's what I've ment when talking about directory-entries...ofcoz it has a directory, but not subdirectories!

A bit off topic but you can use Make Dir to create directories on disk (1541):

Make Dir

2009-05-13 18:16
Mix256
Account closed

Registered: Dec 2008
Posts: 26
K, fiddled some.
As you say, the first free directory-entry is used.
My 3rd file gets removed and then reinserted again, just as I want it to.

BUT when doing a load"*",8,1, the first file isn't loaded. This 3rd file is loaded instead...
Got a MMC Replay inserted. Could that do that kind of thing?

 
... 6 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
iceout/Avatar/HF
Acidchild/Padua
Bieno/Commodore Plus
iAN CooG/HVSC
Magic/Nah-Kolor
RetroGL
Soya/Fairlight
Guests online: 163
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.045 sec.