Rev 4634 | Rev 5512 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4634 | Rev 4645 | ||
---|---|---|---|
Line 10... | Line 10... | ||
10 | notify(in1); |
10 | notify(in1); |
11 | return; |
11 | return; |
12 | } |
12 | } |
13 | if (error = GetFileInfo(from1, #CopyFile_atr1)) |
13 | if (error = GetFileInfo(from1, #CopyFile_atr1)) |
14 | { |
14 | { |
15 | debug("Error: copyf->GetFileInfo"); |
15 | debugln("Error: copyf->GetFileInfo"); |
16 | return error; |
16 | return error; |
17 | } |
17 | } |
18 | if (isdir(from1)) |
18 | if (isdir(from1)) |
19 | return CopyFolder(from1, in1); |
19 | return CopyFolder(from1, in1); |
20 | else |
20 | else |
Line 28... | Line 28... | ||
28 | { |
28 | { |
29 | BDVK CopyFile_atr; |
29 | BDVK CopyFile_atr; |
30 | dword error, cbuf; |
30 | dword error, cbuf; |
31 | if (error = GetFileInfo(copy_from3, #CopyFile_atr)) |
31 | if (error = GetFileInfo(copy_from3, #CopyFile_atr)) |
32 | { |
32 | { |
33 | debug("Error: CopyFile->GetFileInfo"); |
33 | debugln("Error: CopyFile->GetFileInfo"); |
34 | } |
34 | } |
35 | else |
35 | else |
36 | { |
36 | { |
37 | cbuf = malloc(CopyFile_atr.sizelo); |
37 | cbuf = malloc(CopyFile_atr.sizelo); |
38 | if (error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3)) |
38 | if (error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3)) |
39 | { |
39 | { |
40 | debug("Error: CopyFile->ReadFile"); |
40 | debugln("Error: CopyFile->ReadFile"); |
41 | } |
41 | } |
42 | else |
42 | else |
43 | { |
43 | { |
44 | if (error = WriteFile(CopyFile_atr.sizelo, cbuf, copy_in3)) debug("Error: CopyFile->WriteFile"); |
44 | if (error = WriteFile(CopyFile_atr.sizelo, cbuf, copy_in3)) debugln("Error: CopyFile->WriteFile"); |
45 | } |
45 | } |
46 | } |
46 | } |
47 | free(cbuf); |
47 | free(cbuf); |
48 | if (error) debug_error(copy_from3, error); |
48 | if (error) debug_error(copy_from3, error); |
49 | return error; |
49 | return error; |
Line 54... | Line 54... | ||
54 | dword dirbuf, fcount, i, filename; |
54 | dword dirbuf, fcount, i, filename; |
55 | char copy_from2[4096], copy_in2[4096], error; |
55 | char copy_from2[4096], copy_in2[4096], error; |
Line 56... | Line 56... | ||
56 | 56 | ||
57 | if (error = GetDir(#dirbuf, #fcount, from2, DIRS_ONLYREAL)) |
57 | if (error = GetDir(#dirbuf, #fcount, from2, DIRS_ONLYREAL)) |
58 | { |
58 | { |
59 | debug("Error: CopyFolder->GetDir"); |
59 | debugln("Error: CopyFolder->GetDir"); |
60 | debug_error(from2, error); |
60 | debug_error(from2, error); |
61 | free(dirbuf); |
61 | free(dirbuf); |
62 | return error; |
62 | return error; |
Line 63... | Line 63... | ||
63 | } |
63 | } |
64 | 64 | ||
65 | if (chrnum(in2, '/')>2) && (error = CreateDir(in2)) |
65 | if (chrnum(in2, '/')>2) && (error = CreateDir(in2)) |
66 | { |
66 | { |
67 | debug("Error: CopyFolder->CreateDir"); |
67 | debugln("Error: CopyFolder->CreateDir"); |
68 | debug_error(in2, error); |
68 | debug_error(in2, error); |
69 | free(dirbuf); |
69 | free(dirbuf); |
Line 88... | Line 88... | ||
88 | else |
88 | else |
89 | { |
89 | { |
90 | copyf_Draw_Progress(filename); |
90 | copyf_Draw_Progress(filename); |
91 | if (error=CopyFile(#copy_from2, #copy_in2)) |
91 | if (error=CopyFile(#copy_from2, #copy_in2)) |
92 | { |
92 | { |
93 | if (fabs(error)==8) { debug("Stop copying."); break;} //TODO: may be need grobal var like stop_all |
93 | if (fabs(error)==8) { debugln("Stop copying."); break;} //TODO: may be need grobal var like stop_all |
94 | error=CopyFile(#copy_from2, #copy_in2); // #2 :) |
94 | error=CopyFile(#copy_from2, #copy_in2); // #2 :) |
95 | } |
95 | } |
96 | } |
96 | } |
97 | } |
97 | } |
98 | free(dirbuf); |
98 | free(dirbuf); |
Line 155... | Line 155... | ||
155 | return #error; |
155 | return #error; |
156 | } |
156 | } |
Line 157... | Line 157... | ||
157 | 157 | ||
158 | :void debug_error(dword path, error_number) |
158 | :void debug_error(dword path, error_number) |
159 | { |
159 | { |
160 | if (path) debug(path); |
160 | if (path) debugln(path); |
161 | debug(get_error(error_number)); |
161 | debugln(get_error(error_number)); |
162 | }=33) |
162 | }=33) |