Rev 6646 | 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 | int tst, count, i; |
||
7369 | leency | 33 | |
34 | BDVK file_info_count; |
||
35 | _dir_size delete_dir_size; |
||
36 | dword file_count_delete = 0; |
||
6278 | leency | 37 | copy_bar.value = 0; |
38 | operation_flag = DELETE_FLAG; |
||
39 | |||
40 | if (selected_count) |
||
41 | { |
||
42 | for (i=0; i |
||
43 | { |
||
6646 | leency | 44 | if (getElementSelectedFlag(i) == true) { |
6635 | leency | 45 | sprintf(#del_from,"%s/%s",#path,file_mas[i]*304+buf+72); |
6278 | leency | 46 | GetFileInfo(#del_from, #file_info_count); |
7369 | leency | 47 | if ( file_info_count.isfolder ) { |
48 | delete_dir_size.get(#del_from); |
||
49 | file_count_delete += delete_dir_size.files; |
||
50 | } |
||
51 | else file_count_delete++; |
||
6278 | leency | 52 | } |
53 | } |
||
54 | } |
||
55 | else |
||
56 | { |
||
7369 | leency | 57 | if (itdir) { |
58 | delete_dir_size.get(#file_path); |
||
59 | file_count_delete += delete_dir_size.files; |
||
60 | } |
||
61 | else file_count_delete++; |
||
6278 | leency | 62 | } |
63 | |||
7369 | leency | 64 | copy_bar.max = file_count_delete; |
6278 | leency | 65 | |
66 | del_error = 0; |
||
67 | DisplayOperationForm(); |
||
68 | if (selected_count) |
||
69 | { |
||
70 | for (i=0; i |
||
71 | { |
||
6646 | leency | 72 | if (getElementSelectedFlag(i) == true) { |
6635 | leency | 73 | sprintf(#del_from,"%s/%s",#path,file_mas[i]*304+buf+72); |
6278 | leency | 74 | Del_File2(#del_from, 1); |
75 | } |
||
76 | } |
||
77 | } |
||
78 | else |
||
79 | { |
||
80 | Del_File2(#file_path, 1); |
||
81 | } |
||
82 | if (del_error) Write_Error(del_error); |
||
83 | cmd_free = 6; |
||
84 | DialogExit(); |
||
85 | } |
||
86 | |||
87 | void Del_File(byte dodel) { |
||
88 | del_active=0; |
||
89 | if (dodel) |
||
90 | { |
||
91 | delete_stak = malloc(40000); |
||
92 | CreateThread(#Del_File_Thread,delete_stak+40000-4); |
||
93 | } |
||
94 | else draw_window(); |
||
95 | } |