trouble with COPY /U

If I run this command it works fine

E:
cd E:\intellij\j6m\src\com
copy /UF /S /E /T *.java E:\com

However, if I run it again immediately afterward, it STILL copies all the same files over again. Can anyone think of what might be causing this?

Take Command started doing this a week or so ago.

It also happens with /U and without the /E and without the /T.

I am running Vista Home premium on an NTFS partition.
 
I have done some more work on this.
I installed build 68. I wrote a utlity to dump the create/access/and last modified dates of a file accurate both to the Java ms and MS nanosecond.

I discovered that when the last modified date was identical to the ns in source and target 4NT COPY still copied.

Oddly when I used /U instead of /UF now it works. I took the docs to mean that files with in a 2 seconds slop were considered to have the same timestamp for /UF. I think there is a bug in there somewhere.
 

rconn

Administrator
Staff member
May 14, 2008
12,315
148
Roedy wrote:

> If I run this command it works fine
>
> E:
> cd E:\intellij\j6m\src\com
> copy /UF /S /E /T *.java E:\com
>
> However, if I run it again immediately afterward, it STILL copies all the same files over again. Can anyone think of what might be causing this?
>
> Take Command started doing this a week or so ago.
>
> It also happens with /U and without the /E and without the /T.
>
> I am running Vista Home premium on an NTFS partition.

Not reproducible here.

Assuming you don't have an alias for COPY, this would have to be a
Windows issue on your system. (Both the time comparison and copy are
done by Windows APIs.)

Rex Conn
JP Software
 
May 20, 2008
603
0
Sammamish, WA
I get the same problem using /UF but not with /U

TCC 10.00.68 Windows XP [Version 5.1.2600]
TCC Build 68 Windows XP Build 2600 Service Pack 3


D:\>md TEST

D:\>cd TEST

D:\TEST>echo foo > test.java

D:\TEST>*copy /UF test.java test1.java
D:\TEST\test.java => D:\TEST\test1.java
1 file copied

D:\TEST>*copy /UF test.java test1.java
D:\TEST\test.java => D:\TEST\test1.java
1 file copied

D:\TEST>*copy /U test.java test1.java
0 files copied

On Thu, May 28, 2009 at 5:06 AM, rconn <> wrote:

> Roedy wrote:
>
>
> ---Quote---
>> If I run this command it works fine
>>
>> E:
>> cd E:\intellij\j6m\src\com
>> copy /UF /S /E /T *.java E:\com
>>
>> However, if I run it again immediately afterward, it STILL copies all the same files over again. *Can anyone think of what might be causing this?
>>
>> Take Command started doing this a week or so ago.
>>
>> It also happens with /U and without the /E and without the /T.
>>
>> I am running Vista Home premium on an NTFS partition.
> ---End Quote---
> Not reproducible here.
>
> Assuming you don't have an alias for COPY, this would have to be a
> Windows issue on your system. *(Both the time comparison and copy are
> done by Windows APIs.)
>
> Rex Conn
> JP Software
>
>
>
>
>



--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.
 
May 20, 2008
603
0
Sammamish, WA
>> Assuming you don't have an alias for COPY, this would have to be a
>> Windows issue on your system. *(Both the time comparison and copy are
>> done by Windows APIs.)

Rex:

What are you using for the time comparison?
Are you using CopyFile or CopyFileEx for the file copy?

--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.
 

rconn

Administrator
Staff member
May 14, 2008
12,315
148
Jim Cook wrote:

> ---Quote---
>>> Assuming you don't have an alias for COPY, this would have to be a
>>> Windows issue on your system. *(Both the time comparison and copy are
>>> done by Windows APIs.)
> ---End Quote---
> Rex:
>
> What are you using for the time comparison?
> Are you using CopyFile or CopyFileEx for the file copy?

CopyFileEx for the file copy, and CompareFileTime to compare the last
write times.

Rex Conn
JP Software
 
May 20, 2008
603
0
Sammamish, WA
In my simple program, it shows the last write times compare exactly
equal according to CompareFileTime. However, COPY /UF continues to
copy the file. In fact, when I force all three times to be exactly the
same, COPY /UF continues to copy the file.

I don't see how CompareFileTime can be used to do the /UF function of
"more than 2 seconds newer" directly. You must do some interesting
manipulation instead.



#include "windows.h"
#include "stdio.h"

int main(int argc, char * argv[])
{
HANDLE hFile1, hFile2;
FILETIME ftFileC1, ftFileA1, ftFileW1;
FILETIME ftFileC2, ftFileA2, ftFileW2;

hFile1 = CreateFile(argv[1], GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
if (hFile1 == INVALID_HANDLE_VALUE) abort();
hFile2 = CreateFile(argv[2], GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
if (hFile2 == INVALID_HANDLE_VALUE) abort();

if (!GetFileTime(hFile1, &ftFileC1, &ftFileA1, &ftFileW1)) abort();
if (!GetFileTime(hFile2, &ftFileC2, &ftFileA2, &ftFileW2)) abort();

printf("C=%d A=%d W=%d\n",
CompareFileTime(&ftFileC1, &ftFileC2),
CompareFileTime(&ftFileA1, &ftFileA2),
CompareFileTime(&ftFileW1, &ftFileW2));
}


On Tue, Jun 2, 2009 at 4:52 PM, rconn <> wrote:

> Jim Cook wrote:
>
>
> ---Quote---
>> ---Quote---
>>>> Assuming you don't have an alias for COPY, this would have to be a
>>>> Windows issue on your system. *(Both the time comparison and copy are
>>>> done by Windows APIs.)
>> ---End Quote---
>> Rex:
>>
>> What are you using for the time comparison?
>> Are you using CopyFile or CopyFileEx for the file copy?
> ---End Quote---
> CopyFileEx for the file copy, and CompareFileTime to compare the last
> write times.
>
> Rex Conn
> JP Software
>
>
>
>
>



--
Jim Cook
2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Sunday.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
Jim Cook wrote:
|| In my simple program, it shows the last write times compare exactly
|| equal according to CompareFileTime. However, COPY /UF continues to
|| copy the file. In fact, when I force all three times to be exactly
|| the
|| same, COPY /UF continues to copy the file.

It is my observation, too, that COPY /UF copies files of the same age.
--
Steve
 
Similar threads
Thread starter Title Forum Replies Date
R Trouble with @REGSET[] Support 6
J Trouble with @full[] function. Support 3
cgunhouse Trouble with Relational Expression Support 4
old coot TC DIR command has trouble on my SSD Support 2
S Trouble accessing results of forum search Support 2
vefatica Trouble closing TCMD Support 0
M Trouble loading alias list Support 2
Jay Sage CascadePoint Fails to Install (And Some Trouble with TCMD) Support 2
S PDIR has trouble processing filenames with embedded percent sign Support 3
Juanma Barranquero Ctrl-C trouble Support 1
J trouble redirecting output to environment variable Support 7
C Copy (sys) error Support 3
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
vefatica Copy/Paste anomaly Support 4
D Documentation Typo in COPY help Support 0
samintz COPY fails to copy from \\wsl$ Support 20
D Differences between TCC and CMD with COPY /b Support 4
fpefpe copy /u and timestamps Support 4
M Strange error messages from TCC in FTP copy Support 7
G TCMD crash when copy Support 3
Alpengreis How to? Copy DIRs with attributes ... Support 4
E Text copy bug Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
fpefpe copy/cat Support 7
K copy /w slow relative to robocopy /mir Support 0
Jay Sage Problem with Context Menu Copy+Paste+Run Key Assignment Support 7
K "copy /z /w" command not deleting read-only files in destination Support 10
K copy changing destination current directory Support 1
D Keystroke to copy previous argument Support 3
A How to? Copy+Paste in TCMD tabs with Ctrl-Shift-Ins? Support 5
RChrismon How to? Copy TCMD.INI to New Version Support 7
R How to? Append files in multiple subfolders using copy? Support 8
Dick Johnson COPY /u (?) Support 9
fpefpe Documentation copy /u Support 7
R How to? copy /q ABC.txt + DEF.txt is appending hex 1A Support 8
D copy /g only shows transfer rate Support 1
J Error "Contents lost before copy" Support 3
B Can copy command concatenate multiple mp3 files Support 2
rps Documentation "Copy+Paste+run" question Support 2
kb6ojs Make /G parameter persistent in COPY/MOVE command? Support 4
fpefpe How to? copy / exclude Support 2
fpefpe robocopy -- copy /w Support 8
C copy /w /p prompts for deletion, but ... Support 3
D Fixed Copy Support 1
fpefpe Documentation copy/move using /c or /u Support 2
samintz WAD Copy/append adds a character Support 3
P Simple RegEx copy Support 9
fromano Fixed COPY ... TO ... crashing Support 3
Alpengreis How to? Copy & Paste without linebreak within TCMD Support 13
D COPY returns ERRORLEVEL 2 Support 5

Similar threads