Rev 5515 | Rev 5642 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5515 | Rev 5598 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | //copyf - copy file or folder with content |
1 | //copyf - copy file or folder with content |
- | 2 | #ifndef INCLUDE_COPYF_H |
|
- | 3 | #define INCLUDE_COPYF_H |
|
- | 4 | ||
- | 5 | #ifndef INCLUDE_FILESYSTEM_H |
|
- | 6 | #include "../lib/file_system.h" |
|
- | 7 | #endif |
|
Line 2... | Line 8... | ||
2 | 8 | ||
3 | :int copyf(dword from1, in1) |
9 | :int copyf(dword from1, in1) |
4 | { |
10 | { |
5 | dword error; |
11 | dword error; |
Line 73... | Line 79... | ||
73 | } |
79 | } |
Line 74... | Line 80... | ||
74 | 80 | ||
75 | for (i=0; i |
81 | for (i=0; i |
76 | { |
82 | { |
77 | filename = i*304+dirbuf+72; |
- | |
78 | strcpy(#copy_from2, from2); |
- | |
79 | chrcat(#copy_from2, '/'); |
83 | filename = i*304+dirbuf+72; |
80 | strcat(#copy_from2, filename); |
- | |
81 | strcpy(#copy_in2, in2); |
- | |
82 | chrcat(#copy_in2, '/'); |
84 | sprintf(#copy_from2,"%s/%s",from2,filename); |
Line 83... | Line 85... | ||
83 | strcat(#copy_in2, filename); |
85 | sprintf(#copy_in2,"%s/%s",in2,filename); |
84 | 86 | ||
85 | if ( TestBit(ESDWORD[filename-40], 4) ) //isdir? |
87 | if ( TestBit(ESDWORD[filename-40], 4) ) //isdir? |
86 | { |
88 | { |
87 | if ( (!strcmp(filename, ".")) || (!strcmp(filename, "..")) ) continue; |
89 | if ( (!strncmp(filename, ".",1)) || (!strncmp(filename, "..",2)) ) continue; |
88 | CopyFolder(#copy_from2, #copy_in2); |
90 | CopyFolder(#copy_from2, #copy_in2); |
89 | } |
91 | } |
90 | else |
92 | else |
Line 143... | Line 145... | ||
143 | 145 | ||
144 | :dword get_error(int N) |
146 | :dword get_error(int N) |
145 | { |
147 | { |
146 | char error[256]; |
148 | char error[256]; |
147 | N = fabs(N); |
- | |
148 | if (N<=33) |
- | |
149 | { |
149 | N = fabs(N); |
150 | strcpy(#error, ERROR_TEXT[N]); |
- | |
151 | } |
- | |
152 | else |
- | |
153 | { |
- | |
154 | strcpy(#error, itoa(N)); |
150 | if (N<=33) strcpy(#error, ERROR_TEXT[N]); |
155 | strcat(#error, " - Unknown error number O_o"); |
- | |
156 | } |
151 | else sprintf(#error,"%d%s",N," - Unknown error number O_o"); |
157 | return #error; |
152 | return #error; |
Line 158... | Line 153... | ||
158 | } |
153 | } |
159 | 154 | ||
160 | :void debug_error(dword path, error_number) |
155 | :void debug_error(dword path, error_number) |
161 | { |
156 | { |
162 | if (path) debugln(path); |
157 | if (path) debugln(path); |
163 | debugln(get_error(error_number)); |
158 | debugln(get_error(error_number)); |
- | 159 | } |
|
- | 160 | ||
164 | }=33) |
161 | #endif=33)> |