Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using COP command
#13
It gives me the same error....
Sorry for no explaining enough in my first post.

The error is:
Error (RT) in SB_Copy: cannot copy file

I have done some tests again.
The order works... but when destination folder doesn't exists, gives the error above.(only when used with the other flags).
If I do a 'cop a b FOF_NOCONFIRMMKDIR' without any other flag works fine (slow, but works)

It's a bit strange......

I'm using QM 2.2.1.5 :-(
I'll look up a bit more..... Thanks.


EDIT: Here is the code of the function SB_Copy.
At the end, where is the copy of the file, I have putted 3 "modes". Obviously, I have run the macro with two of them commented.
In comments, are the results: Times (sum of all, and divided by 6), filesize, the same. The smallest was 1615K and the biggest 2310K.
Code:
Copy      Help
function ~F1 ~Path1 ~Path2 #Num [#Version]
;;;F1 = Filename with relative path
;;;Path1 = Source
;;;Path2 = Destination
;;;Num = Max.Versions available
;;;Version = Current version. for recursivity


if(!Version) Version=0
str name = SB_getVersionName(F1 Path2 Version 2)

str a b
Dir d
if (d.dir(name)) ;; name exists.
,if (Version < Num)
,,SB_Copy(F1 Path1 Path2 Num (Version+1))
,else
,,;del- name
,,out "Delete %s" name
if (Version>0)
,a = SB_getVersionName(F1 Path2 (Version-1) 2)
,b = name
,;out "Ren %s %s" a b
,ren a b FOF_SILENT
if(Version=0)
,a.format("%s%s" Path1 F1)
,b.format("%s%s" Path2 F1)
,out "Cop %s %s" a b
,
,;MODE 1: (WORKS)
,long perf1 = perf
,cop a b FOF_NOCONFIRMMKDIR
,;perf says about 1000589 for each file. There was 6 files of 1765KB each one
,long perf2 = perf
,out (perf2-perf1)

,;MODE 2: (WORKS only if destination folder exists. Obvious)
,long perf1 = perf
,cop a b FOF_SILENT|FOF_FILESONLY
,;perf says about 25943 for each file. There was 6 files of 1765KB each one
,long perf2 = perf
,out (perf2-perf1)

,;MODE 2: (WORKS like Mode 2. If not exist, crashes)
,long perf1 = perf
,cop a b FOF_NOCONFIRMMKDIR|FOF_SILENT|FOF_FILESONLY
,;perf says about 23108 for each file. There was 6 files of 1765KB each one
,long perf2 = perf
,out (perf2-perf1)
ret


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)