Rev 6602 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6278 | leency | 1 | int del_error; |
2 | int Del_File2(dword way, sh_progr) |
||
3 | { |
||
4 | dword dirbuf, fcount, i, filename; |
||
5 | int error; |
||
6 | char del_from[4096]; |
||
7 | if (dir_exists(way)) |
||
8 | { |
||
9 | if (error = GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL)) del_error = error; |
||
10 | for (i=0; i |
||
11 | { |
||
12 | if (CheckEvent()==evReDraw) draw_window(); |
||
13 | filename = i*304+dirbuf+72; |
||
14 | sprintf(#del_from,"%s/%s",way,filename); |
||
15 | if ( TestBit(ESDWORD[filename-40], 4) ) |
||
16 | { |
||
17 | Del_File2(#del_from, 1); |
||
18 | } |
||
19 | else |
||
20 | { |
||
21 | if (sh_progr) Operation_Draw_Progress(filename); |
||
22 | if (error = DeleteFile(#del_from)) del_error = error; |
||
23 | } |
||
24 | } |
||
25 | } |
||
26 | if (error = DeleteFile(way)) del_error = error; |
||
27 | } |
||
28 | |||
29 | void Del_File_Thread() |
||
30 | { |
||
31 | byte del_from[4096]; |
||
32 | dword selected_offset2; |
||
33 | int tst, count, i; |
||
34 | |||
35 | file_count_copy = 0; |
||
36 | copy_bar.value = 0; |
||
37 | operation_flag = DELETE_FLAG; |
||
38 | |||
39 | if (selected_count) |
||
40 | { |
||
41 | for (i=0; i |
||
42 | { |
||
43 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
||
44 | if (ESBYTE[selected_offset2]) { |
||
6635 | leency | 45 | sprintf(#del_from,"%s/%s",#path,file_mas[i]*304+buf+72); |
6278 | leency | 46 | GetFileInfo(#del_from, #file_info_count); |
47 | if ( file_info_count.isfolder ) DirFileCount(#del_from); |
||
48 | else file_count_copy++; |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 | else |
||
53 | { |
||
54 | if (itdir) DirFileCount(#file_path); |
||
55 | else file_count_copy++; |
||
56 | } |
||
57 | |||
58 | copy_bar.max = file_count_copy; |
||
59 | |||
60 | del_error = 0; |
||
61 | DisplayOperationForm(); |
||
62 | if (selected_count) |
||
63 | { |
||
64 | for (i=0; i |
||
65 | { |
||
66 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
||
67 | if (ESBYTE[selected_offset2]) { |
||
6635 | leency | 68 | sprintf(#del_from,"%s/%s",#path,file_mas[i]*304+buf+72); |
6278 | leency | 69 | Del_File2(#del_from, 1); |
70 | } |
||
71 | } |
||
72 | } |
||
73 | else |
||
74 | { |
||
75 | Del_File2(#file_path, 1); |
||
76 | } |
||
77 | if (del_error) Write_Error(del_error); |
||
78 | cmd_free = 6; |
||
79 | DialogExit(); |
||
80 | } |
||
81 | |||
82 | void Del_File(byte dodel) { |
||
83 | del_active=0; |
||
84 | if (dodel) |
||
85 | { |
||
86 | delete_stak = malloc(40000); |
||
87 | CreateThread(#Del_File_Thread,delete_stak+40000-4); |
||
88 | } |
||
89 | else draw_window(); |
||
90 | } |