• DirectInfo.GetFiles返回数组的默认排序


    这个问题来自论坛提问,其实这个函数在.net类库中还有其他等效的函数,这一系列函数的返回结果都是文件名组成的数组,那么他们的默认顺序是根据什么来排列的?开始随口回答人家说是文件名,当然被人小小的bs了一下...稍微考虑一下,这系列函数无非是通过FindFirstFile和FindNextFile这些widows api函数来实现的,拿这些函数的默认顺序是什么呢,msdn了一下,得到如下结果

    The  order  in  which  this  function  returns  the  file  names  is  dependent  on  the  file  system  type.  With  NTFS  and  CDFS  file  systems,  the  names  are  returned  in  alphabetical  order.  With  FAT  file  systems,  the  names  are  returned  in  the  order  the  files  were  written  to  the  disk,  which  may  or  may  not  be  in  alphabetical  order.

    大致意思是
    NTFS和CDFS下,是按照字母顺序,而FAT下,按照文件创建时间顺序

  • 相关阅读:
    【洛谷P1330】封锁阳光大学
    【洛谷P1087】FBI树
    hdu 4504(动态规划)
    hdu 4503(数学,概率)
    hdu 5400(思路题)
    hdu 5701(区间查询思路题)
    hdu 4502(DP)
    hdu 1401(单广各种卡的搜索题||双广秒速)
    hdu 1258(DFS)
    hdu 1254(搜索题)
  • 原文地址:https://www.cnblogs.com/cl1024cl/p/6204855.html
Copyright © 2020-2023  润新知