我对原版很感兴趣
这里的问题和相关问题。
为了得到答案,这周我做了一些
使用 XCOPY 进行实验。
为了帮助回答原始问题,请点击此处
我发布了我的实验结果。
我在 Windows 7 64 位上进行了实验
带有 XCOPY 副本的 Professional SP1
操作系统自带的。
为了实验,我在
脚本语言 Open Object Rexx
和编辑器宏语言 Kexx
文本编辑器 KEdit。
XCOPY 是从 Rexx 代码调用的。这
Kexx 代码编辑了屏幕输出
XCOPY 以专注于关键结果。
实验都与使用有关
XCOPY 复制一个目录有几个
文件和子目录。
实验由 10 个案例组成。
每个案例都将参数调整为 XCOPY
并调用 XCOPY 一次。 10 例均为
试图做同样的复制
操作。
以下是主要结果:
(1) 10 例中,只有 3 例
复制。其他7例马上,
只是从处理论点到
XCOPY,给出错误信息,例如,
Invalid path
Access denied
没有复制任何文件。
在进行复制的三个案例中,他们
所有人都做了同样的复制,也就是说,给了
相同的结果。
(2) 如果要复制一个目录 X 和所有
目录 X 中的文件和目录,
在分层文件系统树中
植根于目录 X,然后显然
XCOPY——这似乎是
最初的问题——只是不会做
那个。
一个后果是,如果使用 XCOPY
复制目录 X 及其内容,然后
可以复制内容但不能复制
目录 X 本身;因此,失去
目录 X 上的时间戳,它的
存档位,所有权数据,
属性等
当然,如果目录 X 是子目录
目录 Y,Y 的 XCOPY 将复制
目录 Y WITH 的所有内容
目录X。所以这样可以得到一份拷贝
目录 X. 但是,
目录 X 将有它的时间戳
XCOPY 和 NOT 的运行时间
原件的时间戳
目录 X。
时间戳的这种变化可以
对于一个目录的副本来说很尴尬
大量下载的网页:HTML
网页的文件将有它的
原始时间日期戳,但
所用文件的相应子目录
由 HTML 文件将有时间-日期
XCOPY 运行的印章。那么,当
按时间日期戳对副本进行排序,所有
子目录、HTML 文件和
对应的子目录,例如,
x.htm
x_files
在排序中可能会显得相距很远
时间-日期。
分层文件系统可以追溯到很久以前,
IIRC 于 1969 年在 MIT 转为 Multics,此后
然后很多人都认出了
两种情况,给定目录 X,(i) 复制
目录 X 及其所有内容和 (ii)
复制 X 的所有内容,但不复制
目录 X 本身。好吧,如果只是从
实验,XCOPY 只做 (ii)。
所以,10 个案例的结果如下。
对于每种情况,结果中的第一个
三行有前三个参数
到 XCOPY。所以,第一行有树
要复制的目录的名称,
'资源';第二行有树
获取副本的目录名称,
“目的地”,第三行有
XCOPY 的选项。剩下的1-2
行有运行的结果
复制。
关于选项的一大要点是
选项 /X 和 /O 产生结果
Access denied
要查看这一点,请将案例 8 与其他案例进行比较
相同的情况,没有 /X
和 /O,但确实复制了。
这些实验让我变得更好
了解 XCOPY 并提供答案
到原来的问题。
======= case 1 ==================
"k:\software\dir_time-date\"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_1\"
options = /E /F /G /H /K /O /R /V /X /Y
Result: Invalid path
Result: 0 File(s) copied
======= case 2 ==================
"k:\software\dir_time-date\*"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_2\"
options = /E /F /G /H /K /O /R /V /X /Y
Result: Access denied
Result: 0 File(s) copied
======= case 3 ==================
"k:\software\dir_time-date"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_3\"
options = /E /F /G /H /K /O /R /V /X /Y
Result: Access denied
Result: 0 File(s) copied
======= case 4 ==================
"k:\software\dir_time-date\"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_4\"
options = /E /F /G /H /K /R /V /Y
Result: Invalid path
Result: 0 File(s) copied
======= case 5 ==================
"k:\software\dir_time-date\"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_5\"
options = /E /F /G /H /K /O /R /S /X /Y
Result: Invalid path
Result: 0 File(s) copied
======= case 6 ==================
"k:\software\dir_time-date"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_6\"
options = /E /F /G /H /I /K /O /R /S /X /Y
Result: Access denied
Result: 0 File(s) copied
======= case 7 ==================
"k:\software\dir_time-date"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_7"
options = /E /F /G /H /I /K /R /S /Y
Result: 20 File(s) copied
======= case 8 ==================
"k:\software\dir_time-date"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_8"
options = /E /F /G /H /I /K /O /R /S /X /Y
Result: Access denied
Result: 0 File(s) copied
======= case 9 ==================
"k:\software\dir_time-date"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_9"
options = /I /S
Result: 20 File(s) copied
======= case 10 ==================
"k:\software\dir_time-date"
"k:\software\xcopy002_test\xcopy002_test_dirs\output_sub_dir_10"
options = /E /I /S
Result: 20 File(s) copied