命令COPY以什么顺序将文件从源复制到目标? [英] In which order does command COPY copy files from source to destination?

查看:259
本文介绍了命令COPY以什么顺序将文件从源复制到目标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的批处理文件,可将大量图像从网络驱动器复制到本地驱动器,而在运行过程中必须将其停止.

I have a simple batch file copying a large list of images from a network drive to a local drive which I had to stop in the middle of running.

c:\pic>copy i:\pictures\*.*

它似乎是按字母顺序复制的.

It appears to be copying in alphabetical order.

知道这是否是默认设置吗?

Any idea if that would be the default?

我想从中间重新开始,因为复制需要很长时间.

I'd like to restart from the middle as it takes a very long time to copy.

推荐答案

所有使用通配符模式处理文件或目录列表的命令都调用相同的Windows内核函数,后者调用文件系统的驱动程序以返回文件/与模式匹配的目录名称.

All commands using a wildcard pattern to process a list of files or directories call the same Windows kernel functions which call the driver of the file system to return the file/directory names matching the pattern.

COPY DEL DIR FOR 等命令不会对符合以下条件的文件名进行排序处理前的通配符模式. DIR 具有选项/O,可根据下一个字符请求有序输出.

The commands COPY, DEL, DIR, FOR, etc. do not sort file names matching a wildcard pattern before processing. DIR has option /O to request an ordered output depending on next character.

NTFS (新技术文件系统)返回的文件名始终与字母的通配符模式匹配顺序是因为按字母顺序将文件/目录名称添加到主文件表中,如 eryksun 在他的评论中所述.

NTFS (New Technology File System) returns file names matching a wildcard pattern always in alphabetic order because of adding file/directory names in alphabetic order to the master file table as eryksun explained in his comments.

但是基于 FAT 的其他文件系统也很常见,例如FAT16,FAT32或exFAT在Windows上不要这样做.这些文件系统的驱动程序返回文件分配表中当前存储的文件/目录名,这意味着文件名的顺序根本没有排序.

But other file systems like the FAT based file systems FAT16, FAT32 or exFAT also common on Windows don't do that. The drivers of those file systems return the file/directory names as currently stored in file allocation table which means the order of file names is not sorted at all.

看起来源驱动器正在使用NTFS.因此,文件是按字母顺序复制的.

It looks like the source drive uses NTFS. For that reason the files were copied in alphabetic order.

但是请注意,有多种方法可以对字符串进行字母顺序排序.例如,字母顺序可以严格地根据字符的代码值,或者可以考虑区域和语言特定方面.特定于语言的字母排序通常称为地区字母排序排序,例如对于德语ä = aÄ = A等,尽管字符的代码值是不同.

But please note that there are different methods for alphabetic ordering of strings. For example an alphabetic order can be strictly according to code values of the characters or can take region and language specific aspects into account. A language specific alphabetic sort is often called a locale alphabetic sort where for example for German ä=a, Ä=A, etc. although the code values of the characters are different.

应用程序通常还使用字母数字排序算法,这意味着名称为Test1.txtTest10.txtTest2.txt的3个文件(基于字母代码值的排序)的排序顺序不在此处列出,而是Test2.txtTest10.txt.

Applications often use also an alphanumeric sort algorithm which means the sort order for the 3 files with the names Test1.txt, Test10.txt and Test2.txt (alphabetic code value based sort) is not as listed here, but Test1.txt, Test2.txt and Test10.txt.

eryksun 在他的第三条评论中写道,NTFS文件名的顺序可以与顺序不同Windows资源管理器使用的文件名(请参阅 Windows资源管理器中的排序顺序)或使用以下命令命令 DIR 选项/ON.

So as eryksun wrote in his third comment, the ordering of the file names of NTFS can be different to the order of file names used by Windows Explorer (see Sort order in Windows Explorer) or to command DIR with option /ON.

这篇关于命令COPY以什么顺序将文件从源复制到目标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆