Dear,We suppose that during the copy action something is going wrong.
Code without debug info:
code:
$path="d:\Program Files\nav\*.vdb" ; <-- change be changed to other filenames
$temp_file="%temp%\kixtart.tmp"
;
del $temp_file
shell "%comspec% /c dir "+CHR(34)+$path+CHR(34)+" /o:d /b /s >"+$temp_file
shell "%comspec% /c echo ~~~completed~~~ >>"+$temp_file
IF (Exist($temp_file) = 1)
IF (Open(1,$temp_file) = 0)
$file=ReadLine(1)
$file_prev=$file
IF (INSTR($file,"~~~completed~~~") <> 0)
$completed="yes"
ELSE
$completed="no"
ENDIF
WHILE ($completed <> "yes")
$file=ReadLine(1)
IF (INSTR($file,"~~~completed~~~") = 0)
IF (GetFileTime($file) > GetFileTime($file_prev))
? " delete "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)"
IF (SetFileAttr($file_prev, 32) <> 0)
? "Error "+$error+": "+@serror
ENDIF
del $file_prev
$file_prev=$file
ELSE
? " delete "+$file+" ("+GetFileTime($file)+" "+GetFileSize($file)+" bytes)"
IF (SetFileAttr($file, 32) <> 0)
? "Error "+$error+": "+@serror
ENDIF
del $file
ENDIF
ELSE
$completed="yes"
ENDIF
LOOP
?
IF (INSTR($file_prev,"~~~completed~~~") = 0)
? " most recent file = "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)"
ELSE
? " no file '"+$path+"'"
ENDIF
ENDIF
ENDIF
del $temp_file
The line:
code:
shell "%comspec% /c dir "+CHR(34)+$path+CHR(34)+" /o:d /b /s >"+$temp_file
is extended with the CHR(34) characters for handling long filenames.To trace a possible problem we have include a debug version of above
code.
code:
del "c:\kixtart.txt"
IF RedirectOutput("c:\kixtart.txt")
ENDIF?"- 1-"
?"- 2-" $path="d:\Program Files\nav\*.vdb" ; <-- change be changed to other filenames
?"- 3-" $temp_file="%temp%\kixtart.tmp"
?"- 4-" ;
?"- 5-" DEL $temp_file
?"- 6-" SHELL "%comspec% /c dir "+CHR(34)+$path+CHR(34)+" /o:d /b /s >"+$temp_file
?"- 7-" SHELL "%comspec% /c echo ~~~completed~~~ >>"+$temp_file
?"- 8-" IF (Exist($temp_file) = 1)
?"- 9-" IF (Open(1,$temp_file) = 0)
?"- 10-" $file=ReadLine(1)
?"- 11-" $file_prev=$file
?"- 12-" IF (INSTR($file,"~~~completed~~~") <> 0)
?"- 13-" $completed="yes"
?"- 14-" ELSE
?"- 15-" $completed="no"
?"- 16-" ENDIF
?"- 17-" WHILE ($completed <> "yes")
?"- 18-" $file=ReadLine(1)
?"- 19-" IF (INSTR($file,"~~~completed~~~") = 0)
?"- 20-" IF (GetFileTime($file) > GetFileTime($file_prev))
?"- 21-" ? " delete "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)"
?"- 22-" IF (SetFileAttr($file_prev, 32) <> 0)
?"- 23-" ? "Error "+$error+": "+@serror
?"- 24-" ENDIF
?"- 25-" DEL $file_prev
?"- 26-" $file_prev=$file
?"- 27-" ELSE
?"- 28-" ? " delete "+$file+" ("+GetFileTime($file)+" "+GetFileSize($file)+" bytes)"
?"- 29-" IF (SetFileAttr($file, 32) <> 0)
?"- 30-" ? "Error "+$error+": "+@serror
?"- 31-" ENDIF
?"- 32-" DEL $file
?"- 33-" ENDIF
?"- 34-" ELSE
?"- 35-" $completed="yes"
?"- 36-" ENDIF
?"- 37-" LOOP
?"- 38-" ?
?"- 39-" IF (INSTR($file_prev,"~~~completed~~~") = 0)
?"- 40-" ? " most recent file = "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)"
?"- 41-" ELSE
?"- 42-" ? " no file '"+$path+"'"
?"- 43-" ENDIF
?"- 44-" ENDIF
?"- 45-" ENDIF
?"- 46-" DEL $temp_file
The file c:\kixtart.txt will contain the debug output.
An example of this file can be:
code:
- 1-
- 2-
- 3-
- 4-
- 5-
- 6-
- 7-
- 8-
- 9-
- 10-
- 11-
- 12-
- 13-
- 14-
- 17-
- 38-- 39-
- 42-
no file 'd:\Program Files\nav\*.vdb'
- 43-
- 44-
- 45-
- 46-
When you will get the same message you can see which line
procedure that message.
By email will I send you both files. So a possible disruption
will be prevented.Greetings.