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?










8















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?










share|improve this question









New contributor




TSJNachos117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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















8















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?










share|improve this question









New contributor




TSJNachos117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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













8












8








8








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?










share|improve this question









New contributor




TSJNachos117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question









New contributor




TSJNachos117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




TSJNachos117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 1 hour ago









Stephen Kitt

41k8167176




41k8167176






New contributor




TSJNachos117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 19 hours ago









TSJNachos117TSJNachos117

1412




1412




New contributor




TSJNachos117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





TSJNachos117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






TSJNachos117 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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





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










3 Answers
3






active

oldest

votes


















21














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.






share|improve this answer























  • Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793

    – fernando.reyes
    27 mins ago


















10














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.






share|improve this answer

























  • 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


















4














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.






share|improve this answer























    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.









    draft saved

    draft discarded


















    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









    21














    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.






    share|improve this answer























    • Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793

      – fernando.reyes
      27 mins ago















    21














    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.






    share|improve this answer























    • Some details about long file names, by Raymond Chen: devblogs.microsoft.com/oldnewthing/20110826-00/?p=9793

      – fernando.reyes
      27 mins ago













    21












    21








    21







    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.






    share|improve this answer













    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.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    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

















    • 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











    10














    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.






    share|improve this answer

























    • 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















    10














    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.






    share|improve this answer

























    • 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













    10












    10








    10







    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.






    share|improve this answer















    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.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    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

















    • 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











    4














    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.






    share|improve this answer



























      4














      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.






      share|improve this answer

























        4












        4








        4







        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.






        share|improve this answer













        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 18 hours ago









        RETRACRETRAC

        915311




        915311




















            TSJNachos117 is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Category:Fedor von Bock Media in category "Fedor von Bock"Navigation menuUpload mediaISNI: 0000 0000 5511 3417VIAF ID: 24712551GND ID: 119294796Library of Congress authority ID: n96068363BnF ID: 12534305fSUDOC authorities ID: 034604189Open Library ID: OL338253ANKCR AUT ID: jn19990000869National Library of Israel ID: 000514068National Thesaurus for Author Names ID: 341574317ReasonatorScholiaStatistics

            Reverse int within the 32-bit signed integer range: [−2^31, 2^31 − 1]Combining two 32-bit integers into one 64-bit integerDetermine if an int is within rangeLossy packing 32 bit integer to 16 bitComputing the square root of a 64-bit integerKeeping integer addition within boundsSafe multiplication of two 64-bit signed integersLeetcode 10: Regular Expression MatchingSigned integer-to-ascii x86_64 assembler macroReverse the digits of an Integer“Add two numbers given in reverse order from a linked list”

            Kiel Indholdsfortegnelse Historie | Transport og færgeforbindelser | Sejlsport og anden sport | Kultur | Kendte personer fra Kiel | Noter | Litteratur | Eksterne henvisninger | Navigationsmenuwww.kiel.de54°19′31″N 10°8′26″Ø / 54.32528°N 10.14056°Ø / 54.32528; 10.14056Oberbürgermeister Dr. Ulf Kämpferwww.statistik-nord.deDen danske Stats StatistikKiels hjemmesiderrrWorldCat312794080n790547494030481-4