VOGONS


First post, by R33D3M33R

User metadata
Rank Newbie
Rank
Newbie

Hi all!

Can DosBox show full directory name instead of 8 character long one? It's incredibly confusing, when you have folders that share start of a name in 6 or more characters. It also seems its using some random algorithm to append ~# to the end of the folder name. It's certainly not sorted by name.
Thanks for your time and reply!

Regards!

Reply 1 of 13, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

No, can't do.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 3 of 13, by R33D3M33R

User metadata
Rank Newbie
Rank
Newbie

Huh, thanks for the reply! I guess its just how dosbox works. But how do the items sort when I press tab? If i would know that or if they would at least sort by some natural order algorithm (http://si2.php.net/natcasesort), then it wasn't be necessary to have full directory names displayed.

Thanks!

Reply 4 of 13, by FeedingDragon

User metadata
Rank Oldbie
Rank
Oldbie

NOTE: If you are using a MAC, my entire post will probably be totally wrong and useless.

The ~ named folder's & files are actually created by your OS, not by DOSBox (in case you didn't know that.) This is the actual physical name of it on the HDD (if you can consider anything on a HDD physical.) This is done because of the original FAT limitations on the first drives (HDD or FDD.) The directory listing only had space reserved for 8 characters in the name and 3 characters in the extension (8.3.) What modern OSes do is create the file or directory with the 8.3 name, then put in a header that actually contains the LFN (Long File Name,) for that directory or file, along with other security and flag information that the original RSHA flags don't cover.

Now, in Windows 2000 & XP (not sure about the others,) opening a command prompt and doing a DIR listing with the /X flag will show you the 8.3 versions for each file as well. This may be able to help you. Though the previous suggestion of sticking with the old MS-DOS and pre Windows 95 8.3 file name limitations with any directory that will be mounted in DOSBox is actually much better.

Feeding Dragon

Reply 5 of 13, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

not entirely true.
the ~ names are generated by dosbox and can actually differ from the ones generated by your OS.

Water flows down the stream
How to ask questions the smart way!

Reply 6 of 13, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
Qbix wrote:

not entirely true.
the ~ names are generated by dosbox and can actually differ from the ones generated by your OS.

Which is a-good-thing(tm) when you run DOSBox on Linux, MacOSX, Solaris, PSP or some other OS that do not know sh*t about FAT-filesystem.

Reply 7 of 13, by FeedingDragon

User metadata
Rank Oldbie
Rank
Oldbie
Qbix wrote:

not entirely true.
the ~ names are generated by dosbox and can actually differ from the ones generated by your OS.

I guess DOSBox uses the host OS as a filter to read directories, instead of reading them directly? If it just did a direct DOS access to the assigned directories (mount c: c:\oldgames) all it would have access to are the 8.3 complient names until it reads the header block(s) that contain the LFN and extra flags. The only reason I can think of to set up DOSBox to use the OS as a filter would be so that it could be compiled for systems that never had the 8.3 limitation (such as Amiga,) with fewer necessary changes to the code. I never use anything except DOSBox to work in my old games directories, so I don't have to worry about it myself. Just curious now, though, how does DOSBox determine the order of assignment? Is there some way to predict which directories/files will get which number?

Feeding Dragon

Reply 9 of 13, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

it is indeed to keep it simple. (e.g use the same code on all platforms)
It is possible to predict which files gets which number. I think the host OS assigns them by creation date, while dosbox assigns them alphabetically. I would have to look up the sourcecode of the readdir wrapper on windows to be sure on the dosbox part.

Water flows down the stream
How to ask questions the smart way!

Reply 10 of 13, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I think they assign it depending on which number is availible at creation, Windows stores two names per file on the file system.

Create PROGRA~1
Create PROGRA~2
Create PROGRA~3

Delete PROGRA~2

Remaining: ~1 and ~3

1+1=10

Reply 11 of 13, by FeedingDragon

User metadata
Rank Oldbie
Rank
Oldbie
h-a-l-9000 wrote:
I think they assign it depending on which number is availible at creation, Windows stores two names per file on the file system. […]
Show full quote

I think they assign it depending on which number is availible at creation, Windows stores two names per file on the file system.

Create PROGRA~1
Create PROGRA~2
Create PROGRA~3

Delete PROGRA~2

Remaining: ~1 and ~3

Yes, that is the way Win32 does it. When a new file/directory is created, it assigns the first available number after the ~. So if I created 3 directories called "Program Files", "Programming", & "Programable Options" in that order then they would come out like:

Program Files=PROGRA~1
Programming=PROGRA~2
Programable Options=PROGRA~3

If I changed the order it would come out differently:

Programable Options=PROGRA~1
Programming=PROGRA~2
Program Files=PROGRA~3

If I delete "Programming" in the last example, I would then only have 1 & 3 assigned. So, if I create "Program Runtimes" it would then become PROGRA~2, since 2 would then be the lowest avalable assignable number for PROGRA~ file names.

I'm not sure what would happen if I created more than 9 files/directories with the same first 6 letters. It has never come up for me 😒 Thinking of running a little experiment 😀

Feeding Dragon

Reply 12 of 13, by R33D3M33R

User metadata
Rank Newbie
Rank
Newbie

Well, i read the answers, and I'm confused now. I studied the behavior on Windows XP and Linux (Ubuntu) and Windows does sort the items by their filename, Linux unfortenately not.That is really strange ...

Reply 13 of 13, by ADDiCT

User metadata
Rank Oldbie
Rank
Oldbie

Just use 8.3 filenames for anything DOSBox. If you want to use long file or directory names, create a "long" parent dir, and a 8.3 dir for DOSBox beneath it.