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下,按照文件创建时间顺序

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值