What order were files/directories output in dir? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Where and what was Haunt.bat? A game pre-loaded on a c1992 PCIs there a simple way to display ANSI art and animation files in a modern terminal window?Which MS-/PC-DOS version was the first to allow multiple partitions to be used?How to patch binaries in DOS?What are these tiny TSRs doing?An old DOS application that allowed to create cards, posters, invitations, etcWhat 286 chipsets support UMBs?
What is the difference between globalisation and imperialism?
How to run automated tests after each commit?
Is CEO the "profession" with the most psychopaths?
Central Vacuuming: Is it worth it, and how does it compare to normal vacuuming?
Would it be easier to apply for a UK visa if there is a host family to sponsor for you in going there?
What is an "asse" in Elizabethan English?
One-one communication
Do I really need to have a message in a novel to appeal to readers?
How did Fremen produce and carry enough thumpers to use Sandworms as de facto Ubers?
How do living politicians protect their readily obtainable signatures from misuse?
Hangman Game with C++
Should a wizard buy fine inks every time he want to copy spells into his spellbook?
What to do with repeated rejections for phd position
Would it be possible to dictate a bech32 address as a list of English words?
An adverb for when you're not exaggerating
What are the discoveries that have been possible with the rejection of positivism?
Is there hard evidence that the grant peer review system performs significantly better than random?
How does the math work when buying airline miles?
The Nth Gryphon Number
What does it mean that physics no longer uses mechanical models to describe phenomena?
Sum letters are not two different
Lagrange four-squares theorem --- deterministic complexity
preposition before coffee
In musical terms, what properties are varied by the human voice to produce different words / syllables?
What order were files/directories output in dir?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Where and what was Haunt.bat? A game pre-loaded on a c1992 PCIs there a simple way to display ANSI art and animation files in a modern terminal window?Which MS-/PC-DOS version was the first to allow multiple partitions to be used?How to patch binaries in DOS?What are these tiny TSRs doing?An old DOS application that allowed to create cards, posters, invitations, etcWhat 286 chipsets support UMBs?
In the version of command.com included with MS-DOS, DIR
seems to print files in a random order, but if one runs multiple DIR
commands, they all print the files in the same order. This order does not appear to be based on date, size, or alphabetization. So what is the order? Does it simply print whatever files it finds first?
ms-dos
New contributor
add a comment |
In the version of command.com included with MS-DOS, DIR
seems to print files in a random order, but if one runs multiple DIR
commands, they all print the files in the same order. This order does not appear to be based on date, size, or alphabetization. So what is the order? Does it simply print whatever files it finds first?
ms-dos
New contributor
related: Default file order of "dir" command in Windows console, What order does the DIR command arrange files if no sort order is specified?
– phuclv
2 hours ago
add a comment |
In the version of command.com included with MS-DOS, DIR
seems to print files in a random order, but if one runs multiple DIR
commands, they all print the files in the same order. This order does not appear to be based on date, size, or alphabetization. So what is the order? Does it simply print whatever files it finds first?
ms-dos
New contributor
In the version of command.com included with MS-DOS, DIR
seems to print files in a random order, but if one runs multiple DIR
commands, they all print the files in the same order. This order does not appear to be based on date, size, or alphabetization. So what is the order? Does it simply print whatever files it finds first?
ms-dos
ms-dos
New contributor
New contributor
edited 1 hour ago
Stephen Kitt
41k8167176
41k8167176
New contributor
asked 19 hours ago
TSJNachos117TSJNachos117
1412
1412
New contributor
New contributor
related: Default file order of "dir" command in Windows console, What order does the DIR command arrange files if no sort order is specified?
– phuclv
2 hours ago
add a comment |
related: Default file order of "dir" command in Windows console, What order does the DIR command arrange files if no sort order is specified?
– phuclv
2 hours ago
related: Default file order of "dir" command in Windows console, What order does the DIR command arrange files if no sort order is specified?
– phuclv
2 hours ago
related: Default file order of "dir" command in Windows console, What order does the DIR command arrange files if no sort order is specified?
– phuclv
2 hours ago
add a comment |
3 Answers
3
active
oldest
votes
When a new file is created in a FAT-based file system, its entry will be placed in the first vacant directory slot, if there is one, or else the directory will be extended to add another cluster worth of vacant slots (and the new entry will be placed in the first of those). If no files are ever deleted, files will be assigned directory entries in the order of creation.
Before the advent of long file names, each file that was deleted would result in an empty directory slot, which would get filled by the next file to be created. Long file names complicate this process because they are stored using multiple consecutive directory slots (though I don't know the exact process).
The "dir" command in MS-DOS defaults to reporting files in the same order as their directory entries, but command-line arguments in later versions allow sorting by various criteria.
Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793
– fernando.reyes
27 mins ago
add a comment |
DIR
lists files in the order they’re returned by the find first and find next calls.
On FAT file systems, RAM drives, CD-ROMs etc. this is the order of the directory entries on disk, which on FAT file systems is file creation order as long as no files are deleted. On network file systems, it’s whatever order the server and redirector choose. Other file system drivers can exhibit different behaviour; thus on HPFS and NTFS, which sort directories’ contents on disk, files are returned in the file systems sort order (as can be seen in OS/2 or Windows virtual DOS boxes on HPFS or NTFS volumes).
There are tools which will re-order entries on disk, to provide a permanent sort order for DIR
. Defragmenting could also re-order files (commonly, directories first, then files).
DOS 5 added various sorting options to DIR
itself; the order then depends only on those, when present.
A VDM in OS/2 or Windows NT was a third case, halfway between. Local disc volumes weren't presented as network redirected, but neither were the underlying filesystems unsorted. They were often HPFS or NTFS where directories are sorted by their nature.
– JdeBP
1 hour ago
add a comment |
Whatever it finds first. DIR
in MS-DOS command.com
starts at the beginning of the directory table and reads it through to the end. The files will be in the order they were added to the directory table.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "648"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
TSJNachos117 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f9748%2fwhat-order-were-files-directories-output-in-dir%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
When a new file is created in a FAT-based file system, its entry will be placed in the first vacant directory slot, if there is one, or else the directory will be extended to add another cluster worth of vacant slots (and the new entry will be placed in the first of those). If no files are ever deleted, files will be assigned directory entries in the order of creation.
Before the advent of long file names, each file that was deleted would result in an empty directory slot, which would get filled by the next file to be created. Long file names complicate this process because they are stored using multiple consecutive directory slots (though I don't know the exact process).
The "dir" command in MS-DOS defaults to reporting files in the same order as their directory entries, but command-line arguments in later versions allow sorting by various criteria.
Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793
– fernando.reyes
27 mins ago
add a comment |
When a new file is created in a FAT-based file system, its entry will be placed in the first vacant directory slot, if there is one, or else the directory will be extended to add another cluster worth of vacant slots (and the new entry will be placed in the first of those). If no files are ever deleted, files will be assigned directory entries in the order of creation.
Before the advent of long file names, each file that was deleted would result in an empty directory slot, which would get filled by the next file to be created. Long file names complicate this process because they are stored using multiple consecutive directory slots (though I don't know the exact process).
The "dir" command in MS-DOS defaults to reporting files in the same order as their directory entries, but command-line arguments in later versions allow sorting by various criteria.
Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793
– fernando.reyes
27 mins ago
add a comment |
When a new file is created in a FAT-based file system, its entry will be placed in the first vacant directory slot, if there is one, or else the directory will be extended to add another cluster worth of vacant slots (and the new entry will be placed in the first of those). If no files are ever deleted, files will be assigned directory entries in the order of creation.
Before the advent of long file names, each file that was deleted would result in an empty directory slot, which would get filled by the next file to be created. Long file names complicate this process because they are stored using multiple consecutive directory slots (though I don't know the exact process).
The "dir" command in MS-DOS defaults to reporting files in the same order as their directory entries, but command-line arguments in later versions allow sorting by various criteria.
When a new file is created in a FAT-based file system, its entry will be placed in the first vacant directory slot, if there is one, or else the directory will be extended to add another cluster worth of vacant slots (and the new entry will be placed in the first of those). If no files are ever deleted, files will be assigned directory entries in the order of creation.
Before the advent of long file names, each file that was deleted would result in an empty directory slot, which would get filled by the next file to be created. Long file names complicate this process because they are stored using multiple consecutive directory slots (though I don't know the exact process).
The "dir" command in MS-DOS defaults to reporting files in the same order as their directory entries, but command-line arguments in later versions allow sorting by various criteria.
answered 16 hours ago
supercatsupercat
8,030842
8,030842
Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793
– fernando.reyes
27 mins ago
add a comment |
Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793
– fernando.reyes
27 mins ago
Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793
– fernando.reyes
27 mins ago
Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793
– fernando.reyes
27 mins ago
add a comment |
DIR
lists files in the order they’re returned by the find first and find next calls.
On FAT file systems, RAM drives, CD-ROMs etc. this is the order of the directory entries on disk, which on FAT file systems is file creation order as long as no files are deleted. On network file systems, it’s whatever order the server and redirector choose. Other file system drivers can exhibit different behaviour; thus on HPFS and NTFS, which sort directories’ contents on disk, files are returned in the file systems sort order (as can be seen in OS/2 or Windows virtual DOS boxes on HPFS or NTFS volumes).
There are tools which will re-order entries on disk, to provide a permanent sort order for DIR
. Defragmenting could also re-order files (commonly, directories first, then files).
DOS 5 added various sorting options to DIR
itself; the order then depends only on those, when present.
A VDM in OS/2 or Windows NT was a third case, halfway between. Local disc volumes weren't presented as network redirected, but neither were the underlying filesystems unsorted. They were often HPFS or NTFS where directories are sorted by their nature.
– JdeBP
1 hour ago
add a comment |
DIR
lists files in the order they’re returned by the find first and find next calls.
On FAT file systems, RAM drives, CD-ROMs etc. this is the order of the directory entries on disk, which on FAT file systems is file creation order as long as no files are deleted. On network file systems, it’s whatever order the server and redirector choose. Other file system drivers can exhibit different behaviour; thus on HPFS and NTFS, which sort directories’ contents on disk, files are returned in the file systems sort order (as can be seen in OS/2 or Windows virtual DOS boxes on HPFS or NTFS volumes).
There are tools which will re-order entries on disk, to provide a permanent sort order for DIR
. Defragmenting could also re-order files (commonly, directories first, then files).
DOS 5 added various sorting options to DIR
itself; the order then depends only on those, when present.
A VDM in OS/2 or Windows NT was a third case, halfway between. Local disc volumes weren't presented as network redirected, but neither were the underlying filesystems unsorted. They were often HPFS or NTFS where directories are sorted by their nature.
– JdeBP
1 hour ago
add a comment |
DIR
lists files in the order they’re returned by the find first and find next calls.
On FAT file systems, RAM drives, CD-ROMs etc. this is the order of the directory entries on disk, which on FAT file systems is file creation order as long as no files are deleted. On network file systems, it’s whatever order the server and redirector choose. Other file system drivers can exhibit different behaviour; thus on HPFS and NTFS, which sort directories’ contents on disk, files are returned in the file systems sort order (as can be seen in OS/2 or Windows virtual DOS boxes on HPFS or NTFS volumes).
There are tools which will re-order entries on disk, to provide a permanent sort order for DIR
. Defragmenting could also re-order files (commonly, directories first, then files).
DOS 5 added various sorting options to DIR
itself; the order then depends only on those, when present.
DIR
lists files in the order they’re returned by the find first and find next calls.
On FAT file systems, RAM drives, CD-ROMs etc. this is the order of the directory entries on disk, which on FAT file systems is file creation order as long as no files are deleted. On network file systems, it’s whatever order the server and redirector choose. Other file system drivers can exhibit different behaviour; thus on HPFS and NTFS, which sort directories’ contents on disk, files are returned in the file systems sort order (as can be seen in OS/2 or Windows virtual DOS boxes on HPFS or NTFS volumes).
There are tools which will re-order entries on disk, to provide a permanent sort order for DIR
. Defragmenting could also re-order files (commonly, directories first, then files).
DOS 5 added various sorting options to DIR
itself; the order then depends only on those, when present.
edited 30 mins ago
answered 13 hours ago
Stephen KittStephen Kitt
41k8167176
41k8167176
A VDM in OS/2 or Windows NT was a third case, halfway between. Local disc volumes weren't presented as network redirected, but neither were the underlying filesystems unsorted. They were often HPFS or NTFS where directories are sorted by their nature.
– JdeBP
1 hour ago
add a comment |
A VDM in OS/2 or Windows NT was a third case, halfway between. Local disc volumes weren't presented as network redirected, but neither were the underlying filesystems unsorted. They were often HPFS or NTFS where directories are sorted by their nature.
– JdeBP
1 hour ago
A VDM in OS/2 or Windows NT was a third case, halfway between. Local disc volumes weren't presented as network redirected, but neither were the underlying filesystems unsorted. They were often HPFS or NTFS where directories are sorted by their nature.
– JdeBP
1 hour ago
A VDM in OS/2 or Windows NT was a third case, halfway between. Local disc volumes weren't presented as network redirected, but neither were the underlying filesystems unsorted. They were often HPFS or NTFS where directories are sorted by their nature.
– JdeBP
1 hour ago
add a comment |
Whatever it finds first. DIR
in MS-DOS command.com
starts at the beginning of the directory table and reads it through to the end. The files will be in the order they were added to the directory table.
add a comment |
Whatever it finds first. DIR
in MS-DOS command.com
starts at the beginning of the directory table and reads it through to the end. The files will be in the order they were added to the directory table.
add a comment |
Whatever it finds first. DIR
in MS-DOS command.com
starts at the beginning of the directory table and reads it through to the end. The files will be in the order they were added to the directory table.
Whatever it finds first. DIR
in MS-DOS command.com
starts at the beginning of the directory table and reads it through to the end. The files will be in the order they were added to the directory table.
answered 18 hours ago
RETRACRETRAC
915311
915311
add a comment |
add a comment |
TSJNachos117 is a new contributor. Be nice, and check out our Code of Conduct.
TSJNachos117 is a new contributor. Be nice, and check out our Code of Conduct.
TSJNachos117 is a new contributor. Be nice, and check out our Code of Conduct.
TSJNachos117 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Retrocomputing Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f9748%2fwhat-order-were-files-directories-output-in-dir%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
related: Default file order of "dir" command in Windows console, What order does the DIR command arrange files if no sort order is specified?
– phuclv
2 hours ago