Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
enum_files_and_folders_1.c
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
3 #2023 X March 21 19:50 PM Brasília Time
4
5* *
6* Licensa de Copia (C) <2023> <Aurora Boreal> *
7* *
8* Este programa e software livre: voce pode redistribuir isto e/ou *
9* modificar isto sobre os termos do GNU Licensa Geral Pública como 25
10* publicado pela Fundacao de Software Livre, tanto a versão 3 da *
11* Licensa, ou (dependendo da sua opcao) qualquer versao posterior. *
12* *
13* Este programa e distribuido na esperanca que isto vai ser util, *
14* mas SEM QUALQUER GARANTIA; sem ate mesmo a implicada garantia de *
15* COMERCIALIZAcaO ou CABIMENTO PARA UM FIM PARTICULAR. Veja a *
16* Licensa Geral Publica para mais detalhes. *
17* *
18* Você deve ter recebido uma cópia da LICENSA GERAL PUBLICA e a GNU *
19* Licensa Publica Menor junto com este programa *
20* Se não, veja <http://www.gnu.org/licenses/>. *
21* *
22* Suporte: sourceforge.net github.com *
23* *
24* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
25
26* Pereira: arsoftware25@gmail.com ricardo@arsoftware.net.br *
27* xcx: arsoftware10@gmail.com charli@arsoftware.net.br *
28 Yasmin: yasmin@arsoftware.net.br *
29 pereira1001@users.sourceforge.net
30 */
31
32#define IS_DEBUG_APE__ /* kkkkkkkkkkkk */ (-1)
33
34#include "pk2.h"
35
37// oie...
38
51
53
56
57bool is_valid__Pk_folder(char *the_path_k__p)
58{
59
60 if (0 == strcmp(".", the_path_k__p))
61 {
62 return false;
63 }
64 if (0 == strcmp("..", the_path_k__p))
65 {
66 return false;
67 }
68
69 return true;
70}
71
72void get_file_time_pk(char *file_or_folder_to_process, char *timestamp_pk)
73{
74 HANDLE hFile;
75 FILETIME lpCreationTime___jumior;
76 FILETIME lpLastAccessTime_junior;
77 FILETIME lpLastWriteTime__junior;
78
79 {
80 int r_temp = size_of_WCHAR_mem_r(file_or_folder_to_process);
81 WCHAR *ar_temp = (void *)malloc(r_temp);
82 WCHAR *ar_temp2 = (void *)malloc(r_temp);
83
84 hFile =
85 CreateFileW(permissive_name_m_(amanda_asciitowide_1_(file_or_folder_to_process, ar_temp), ar_temp2),
86 /*
87 GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
88 NULL,
89 OPEN_EXISTING,
90 FILE_FLAG_BACKUP_SEMANTICS,
91 NULL);
92 */
93 GENERIC_READ,
94 FILE_SHARE_READ, NULL,
95 OPEN_EXISTING,
96 FILE_FLAG_BACKUP_SEMANTICS,
97 NULL);
98
99 free(ar_temp);
100 free(ar_temp2);
101 }
102
103 if (INVALID_HANDLE_VALUE != hFile)
104 {
105 if (GetFileTime(
106 hFile,
107 &lpCreationTime___jumior,
108 &lpLastAccessTime_junior,
109 &lpLastWriteTime__junior))
110 {
111
112 SYSTEMTIME systime_arp = {0};
113 SYSTEMTIME systime_arp2 = {0};
114
115 FileTimeToSystemTime(
116 &lpLastWriteTime__junior,
117 &systime_arp2);
118 SystemTimeToTzSpecificLocalTime(NULL, &systime_arp2, &systime_arp);
119 Second_k = systime_arp.wSecond;
120 Minute_k = systime_arp.wMinute;
121 Hour_k = systime_arp.wHour;
122 Year_k = systime_arp.wYear;
123 Month_k = systime_arp.wMonth;
124 Day_k = systime_arp.wDay;
125 sprintf(timestamp_pk, "%d-%02d-%02d %02d:%02d",
126 systime_arp.wYear,
127 systime_arp.wMonth,
128 systime_arp.wDay,
129 systime_arp.wHour,
130 systime_arp.wMinute);
131 }
132 else
133 {
134 strcpy(timestamp_pk, " ");
135 pedro_dprintf(2, "Cannot access timestamp of %s", file_or_folder_to_process);
136 }
137
138 CloseHandle(hFile);
139 }
140 else
141 {
142 pedro_dprintf(2, "%s: Cannot get filetime on folder\n", file_or_folder_to_process);
143 }
144}
158int amanda_s_smart_ape(__attribute__((unused)) char *initial_path_amanda_s_smart_ape,
159 bool recurse_on_subfolders_amanda_s_smart_ape, enum amanda__mode amanda_mode,
160 __attribute__((unused)) bool is_callback)
161{
162
163 struct oi_amanda *oi_amanda_ptr = calloc(1, sizeof(struct oi_amanda));
164
165 struct oi_amanda *oi_amanda_ptr_inicial = oi_amanda_ptr;
166
167 struct oi_amanda *to_call_free______amanda_s_smart_ape;
168
169 WIN32_FIND_DATAW ffd = {0};
170 static char szDir[AMANDA__SIZE];
171 static char szDir_i[AMANDA__SIZE];
172 static char lpcszFolder[AMANDA__SIZE];
173
175 // for ScanFolder
176 static __time64_t s_arp_3;
177 static VAL_data VAL_data_i;
178 int64_t size_i;
179 __attribute__((unused)) int len_i;
180 if (I_MODE_IS_SCANFOLDER == amanda_mode)
181 {
183 }
184
187 // for EnumerateFolder
188
189 int skip_ar = 0;
190
192 // keeping this here int debug_counter_amanda_s_smart_ape = 8;
193
194 strcpy(lpcszFolder, initial_path_amanda_s_smart_ape); //"C:\\Ava\\back\\test_i");
195
196 // strcpy(lpcszFolder, "C:\\");
197
198 // strcpy(lpcszFolder, "C:\\Program Files");//deu? sim querida...
199
200 if (strlen(lpcszFolder))
201 {
202 if ('\\' == lpcszFolder[strlen(lpcszFolder) - 1])
203 {
204 lpcszFolder[strlen(lpcszFolder) - 1] = 0;
205 }
206 }
207
208 // strcpy(oi_amanda_ptr->whole_path_i, lpcszFolder);
209 strcpy(szDir, lpcszFolder);
210 strcat(szDir, "\\*");
211
212 oi_amanda_ptr->parent_hFind_amanda_s_smart______ape = INVALID_HANDLE_VALUE;
213
214 oi_amanda_ptr->previous_amanda_s_smart_ape = NULL;
215
216loop_again_amanda_s_smart_ape:;
217
218 if (1 == 0)
219 {
220 goto loop_again_amanda_s_smart_ape;
221 }
222
223 pedro_dprintf(IS_DEBUG_APE__, "path total %s\n", szDir);
224 // assert(0 && "mais amor?...");
225
226 pedro_dprintf(IS_DEBUG_APE__, "endereco da struct na entrada %p\n", oi_amanda_ptr);
227 {
228 int r_temp = size_of_WCHAR_mem_r(szDir);
229 WCHAR *ar_temp = (void *)malloc(r_temp);
230 WCHAR *ar_temp2 = (void *)malloc(r_temp);
231 oi_amanda_ptr->current_hFind_amanda_s_smart_____ape = FindFirstFileW(permissive_name_m_(amanda_asciitowide_1_(szDir, ar_temp), ar_temp2), &ffd);
232
233 free(ar_temp);
234 free(ar_temp2);
235 }
236 pedro_dprintf(-1, "ok1 \n");
237 if (INVALID_HANDLE_VALUE == oi_amanda_ptr->current_hFind_amanda_s_smart_____ape)
238 {
239 pedro_dprintf(-1, "INVALID_HANDLE_VALUE\n");
240 pedro_dprintf(-1, "path %s\n", szDir);
241 if (oi_amanda_ptr == oi_amanda_ptr_inicial)
242 {
243 pedro_dprintf(-1, "free forçado final on %x\n", oi_amanda_ptr);
244 free(oi_amanda_ptr);
245 oi_amanda_ptr = NULL;
246 goto no_entries_i; // se é um subdiretorio tem . e .. experimente
247 }
248
249 goto keep_running_amanda_s_smart_ape;
250 }
251
252 do
253 {
254
256 {
257 pedro_dprintf(IS_DEBUG_APE__, "Called cancel \n");
258 goto exit_me_forced_amanda_s_smart_ape;
259 }
260
261 if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
262 {
263
264 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
265
266 if (is_valid__Pk_folder(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)))
267 {
268
269 ; // Mr. Do.
270
271 pedro_dprintf(-1, "2 dir -> %s\n", valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
272
273 if (INVALID_HANDLE_VALUE == oi_amanda_ptr->parent_hFind_amanda_s_smart______ape)
274 {
275
276 if (NULL == oi_amanda_ptr->entry______i)
277 {
278 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
279 }
280 else
281 {
282 free(oi_amanda_ptr->entry______i);
283 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
284 }
285
286 strcpy(oi_amanda_ptr->entry______i, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
287 }
288 else
289 {
290
291 if (NULL == oi_amanda_ptr->entry______i)
292 {
293 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) +
294 strlen(oi_amanda_ptr->whole_entry_above_i) +
295 strlen("\\") + 3);
296 }
297 else
298 {
299 free(oi_amanda_ptr->entry______i);
300 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) +
301 strlen(oi_amanda_ptr->whole_entry_above_i) +
302 strlen("\\") + 3);
303 }
304
305 strcpy(oi_amanda_ptr->entry______i, oi_amanda_ptr->whole_entry_above_i);
306 strcat(oi_amanda_ptr->entry______i, "\\");
307 strcat(oi_amanda_ptr->entry______i, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
308 }
309
310 free(ar_temp_char);
311 ar_temp_char = NULL;
312
313 if (recurse_on_subfolders_amanda_s_smart_ape)
314 {
315 oi_amanda_ptr->subfolder_amanda_s_smart_ape = calloc(1, sizeof(struct oi_amanda));
316
317 oi_amanda_ptr->subfolder_amanda_s_smart_ape->previous_amanda_s_smart_ape = oi_amanda_ptr;
318
320 {
321 oi_amanda_ptr->subfolder_amanda_s_smart_ape->whole_entry_above_i = calloc(1, strlen(oi_amanda_ptr->entry______i) + 3);
322 }
323 else
324 {
326 oi_amanda_ptr->subfolder_amanda_s_smart_ape->whole_entry_above_i = calloc(1, strlen(oi_amanda_ptr->entry______i) + 3);
327 }
328
330 oi_amanda_ptr->entry______i);
331
334 }
335
336 strcpy(szDir, lpcszFolder);
337 strcat(szDir, "\\");
338 strcat(szDir, oi_amanda_ptr->entry______i);
339
340 if (is_callback)
341 {
342 strcpy(file_got_pk, oi_amanda_ptr->entry______i);
343
345 {
346 meu_fn_pk_(0, 0);
347 }
348 }
349
350 if (NULL == oi_amanda_ptr->whole_entry_i)
351 {
352 oi_amanda_ptr->whole_entry_i = calloc(1, strlen(szDir) + strlen("\\*") + 3);
353 }
354 else
355 {
356 free(oi_amanda_ptr->whole_entry_i);
357 oi_amanda_ptr->whole_entry_i = calloc(1, strlen(szDir) + strlen("\\*") + 3);
358 }
359
360 strcpy(oi_amanda_ptr->whole_entry_i, szDir);
361
362 /*
363
364
365 aqui tem a entrada inteira...
366
367 dir ->
368
369 oi_amanda_ptr->whole_entry_i -- com path inicial
370 oi_amanda_ptr->entry______i -- so a entrada....
371
372 //vamos converter para utf-8?...
373
374 */
375
376 strcat(szDir, "\\*");
377 // assert(0 && "3");
378
379 pedro_dprintf(IS_DEBUG_APE__, "oi_amanda_ptr->current_hFind_amanda_s_smart_____ape == %x\n", oi_amanda_ptr->current_hFind_amanda_s_smart_____ape);
380
381 pedro_dprintf(IS_DEBUG_APE__, "dir %s\n", oi_amanda_ptr->entry______i);
382 pedro_dprintf(IS_DEBUG_APE__, "dir %s\n", oi_amanda_ptr->whole_entry_i);
383 pedro_dprintf(IS_DEBUG_APE__, "*************************************\n");
384
385 if (recurse_on_subfolders_amanda_s_smart_ape)
386 {
387 /*
388 setor de folders
389 */
390
391 strcpy(whole_entry_i, oi_amanda_ptr->whole_entry_i);
392 strcpy(entry_______i, oi_amanda_ptr->entry______i);
393
394 if (I_MODE_IS_SCANFOLDER == amanda_mode)
395 {
396
398 get_timestamp_arp(whole_entry_i, &s_arp_3, &VAL_data_i);
399
401 atime_i,
402 mtime_i,
403 ctime_i,
404 0,
405 _ftelli64(my___temp_file_i),
407 true,
408 true,
409 0);
410 }
411
412 if (I_MODE_IS_ENUMFOLDER_1 == amanda_mode)
413 {
414 skip_ar = 0;
415
416 if (true || mode_is_VAL_arp) // hack as usual
417 {
418 }
419 else
420 {
421 if (258 < strlen(whole_entry_i)) // not in use anymore
422 {
423 static char temp_ar[AMANDA__SIZE] = {0};
424
425 snprintf(temp_ar, AMANDA__SIZE - 3, "Skipping folder %s because the path is too large for windows", szDir);
426 skip_ar = 1;
427 add_more_one(temp_ar);
428 warning_flag = 28;
430 }
431 }
432
433 if (0 == skip_ar)
434 {
436 {
437 amanda_itens++;
438 }
439 else
440 {
442
444 }
445 }
446
447 while (pause_flag_ar)
448 {
449 Sleep(50);
450
451 if (fatal_exit_k)
452 {
454 break;
455 }
456 }
457 if (fatal_exit_k)
458 {
460 }
461 }
462 }
463
464 if (recurse_on_subfolders_amanda_s_smart_ape)
465 {
466 oi_amanda_ptr = oi_amanda_ptr->subfolder_amanda_s_smart_ape;
467 }
468
469 pedro_dprintf(IS_DEBUG_APE__, "endereco da struct na passagem %p\n", oi_amanda_ptr);
470
471 if (recurse_on_subfolders_amanda_s_smart_ape)
472 {
473 goto loop_again_amanda_s_smart_ape;
474 }
475 }
476 else
477 {
478 free(ar_temp_char);
479 pedro_dprintf(-1, "3 . ou .. \n");
480 continue;
481 }
482 }
483 else
484 {
485
486 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
487
488 pedro_dprintf(-1, "4 file -> %s\n", valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
489
490 if (INVALID_HANDLE_VALUE == oi_amanda_ptr->parent_hFind_amanda_s_smart______ape)
491 {
492 if (NULL == oi_amanda_ptr->entry______i)
493 {
494 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
495 }
496 else
497 {
498 free(oi_amanda_ptr->entry______i);
499 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
500 }
501 strcpy(oi_amanda_ptr->entry______i, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
502 }
503 else
504 {
505 if (NULL == oi_amanda_ptr->entry______i)
506 {
507 oi_amanda_ptr->entry______i = calloc(1, strlen(oi_amanda_ptr->whole_entry_above_i) + strlen("\\") + strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
508 }
509 else
510 {
511 free(oi_amanda_ptr->entry______i);
512 oi_amanda_ptr->entry______i = calloc(1, strlen(oi_amanda_ptr->whole_entry_above_i) + strlen("\\") + strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
513 }
514 strcpy(oi_amanda_ptr->entry______i, oi_amanda_ptr->whole_entry_above_i);
515 strcat(oi_amanda_ptr->entry______i, "\\");
516 strcat(oi_amanda_ptr->entry______i, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
517 }
518 free(ar_temp_char);
519 ar_temp_char = NULL;
520 strcpy(szDir_i, lpcszFolder);
521 strcat(szDir_i, "\\");
522 strcat(szDir_i, oi_amanda_ptr->entry______i);
523
524 if (is_callback)
525 {
526 strcpy(file_got_pk, oi_amanda_ptr->entry______i);
528 {
529 meu_fn_pk_(1, getfilesize_ar(szDir_i));
530 }
531 }
532
533 if (NULL == oi_amanda_ptr->whole_entry_i)
534 {
535 oi_amanda_ptr->whole_entry_i = calloc(1, strlen(szDir_i) + 1);
536 }
537 else
538 {
539 free(oi_amanda_ptr->whole_entry_i);
540 oi_amanda_ptr->whole_entry_i = calloc(1, strlen(szDir_i) + 1);
541 }
542
543 strcpy(oi_amanda_ptr->whole_entry_i, szDir_i);
544
545 pedro_dprintf(IS_DEBUG_APE__, "oi_amanda_ptr->current_hFind_amanda_s_smart_____ape == %x\n", oi_amanda_ptr->current_hFind_amanda_s_smart_____ape);
546
547 pedro_dprintf(IS_DEBUG_APE__, "file %s\n", oi_amanda_ptr->entry______i);
548 pedro_dprintf(IS_DEBUG_APE__, "file %s\n", oi_amanda_ptr->whole_entry_i);
549 pedro_dprintf(IS_DEBUG_APE__, "*************************************\n");
550
551 {
552 /*
553 setor de arquivo
554 */
555
556 strcpy(whole_entry_i, oi_amanda_ptr->whole_entry_i);
557 strcpy(entry_______i, oi_amanda_ptr->entry______i);
558
559 if (I_MODE_IS_SCANFOLDER == amanda_mode)
560 {
561
562 {
563 static char my_copy_of_filename_ar[AMANDA__SIZE];
564
565 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
566
567 strcpy(my_copy_of_filename_ar, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
568
569 free(ar_temp_char);
570
571 strtolower_ar(my_copy_of_filename_ar);
572 {
573 bool achei_o_match = false;
574 const char *my_str_literal = global_patern_ar; //"* *.txt *.ini";
575 char *token, *str, *tofree;
576 tofree = str = strdup(my_str_literal); // We own str's memory now.
577 while ((token = strsep(&str, " ")))
578 {
579 if (strlen(token))
580 {
581 achei_o_match = strmatch(my_copy_of_filename_ar, token,
582 strlen(my_copy_of_filename_ar), strlen(token));
583 }
584 if (achei_o_match)
585 {
586 break;
587 }
588 }
589 free(tofree);
590
591 if (false == true_if_include_i)
592 {
593 if (achei_o_match)
594 {
595 achei_o_match = false;
596 }
597 else
598 {
599 achei_o_match = true;
600 }
601 }
602
603 if (achei_o_match)
604 {
605 /*
606 strcpy(temp_del_entry_i, fixo_path_ar);
607 strcat(temp_del_entry_i, "\\");
608 strcat(temp_del_entry_i, final_file_or_folder_ar);
609 */
610
611 {
612 /*
613 strcpy(dest_entry_i, global_temp_folder_i);
614 strcat(dest_entry_i, "\\");
615 strcat(dest_entry_i, final_file_or_folder_ar);
616 */
617 // if(check_temp_folder_passed_i(global_temp_folder_i, whole_entry_i))
618 {
619 /*
620 stripfilenameandpath(dest_entry_i, dir_out_entry_i, NULL);
621
622 rspmakedir_v2(dir_out_entry_i);
623
624 file_copy_i(temp_del_entry_i, dest_entry_i);
625
626 stripfilenameandpath(temp_del_entry_i, dir_out_entry_2_i, NULL);
627
628 set_folder_time(dir_out_entry_2_i, dir_out_entry_i);
629 */
630 }
631
632 if (is_update_i)
633 {
634
635 get_timestamp_arp(whole_entry_i, &s_arp_3, &VAL_data_i);
636
637 {
639 WCHAR *ar_temp = (void *)malloc(r_temp);
640 WCHAR *ar_temp2 = (void *)malloc(r_temp);
641 attributes_i = GetFileAttributesW(
643 free(ar_temp);
644 free(ar_temp2);
645 }
646
647 /*
648
649 I will keep this for historical reasons...
650
651 {
652
653 int64_t a_i = -1;
654 int b_i = -1;
655
656 if(a_i == b_i)
657 {
658
659 }
660
661 }
662 */
663 if (INVALID_FILE_ATTRIBUTES != attributes_i)
664 {
665 ;
666 }
667 else
668 {
669 attributes_i = 0x20;
670 }
671
672 // [12608] temp_del_entry_i C:\Ava\back\extract_k\taglib-1.11.1\bindings\CMakeLists.txt _amanda_debug_
673
674 {
675
676#define THE_SIZE_I (1 << 17)
677
678 char *buf_i = malloc(THE_SIZE_I);
679 __attribute__((unused)) int len_i;
680 FILE *the_file_i;
681 {
683 WCHAR *ar_temp = /* */ (void *)malloc(r_temp);
684 WCHAR *ar_temp2 = /* */ (void *)malloc(r_temp);
685
686 the_file_i = _wfopen(permissive_name_m_(amanda_asciitowide_1_(whole_entry_i, ar_temp), ar_temp2), L"rb");
687
688 free(ar_temp);
689 free(ar_temp2);
690 }
691 if (the_file_i)
692 {
695 atime_i,
696 mtime_i,
697 ctime_i,
699 _ftelli64(my___temp_file_i),
701 false,
702 true,
704 size_i = 0;
705 while ((len_i = fread(buf_i, 1, THE_SIZE_I, the_file_i)))
706 {
707 ;
708 if ((fwrite(buf_i, 1, len_i, my___temp_file_i)) != (size_t)len_i)
709 {
710 fatal_exit_k = 12345100;
711 }
712 size_i += len_i;
713 }
714
715 fclose(the_file_i);
716 }
717 else
718 {
719 files_that_cannot_be_read_update++; // precisa melhorar isto e mostrar uma lista de arquivos que nao puderam ser lidos...
720 }
721
722 free(buf_i);
723 }
724 }
725 }
726 }
727 }
728 }
729 }
730
731 if (I_MODE_IS_ENUMFOLDER_1 == amanda_mode)
732 {
733 while (pause_flag_ar)
734 {
735 Sleep(50);
736
737 if (fatal_exit_k)
738 {
740 break;
741 }
742 }
743 if (fatal_exit_k)
744 {
746 }
747
748 skip_ar = 0;
749 if (true || mode_is_VAL_arp)
750 {
751 }
752 else
753 {
754 if (258 < strlen(whole_entry_i))
755 {
756 static char temp_ar[AMANDA__SIZE] = {0};
757
758 snprintf(temp_ar, 600, "Skipping folder %s because the path is too large for windows", szDir);
759 skip_ar = 1;
760 add_more_one(temp_ar);
761 warning_flag = 28;
763 }
764 }
765
766 if (0 == skip_ar)
767 {
769 {
770 amanda_itens++;
771 static char my_copy_of_filename_ar[AMANDA__SIZE];
772
773 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
774
775 strcpy(my_copy_of_filename_ar, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
776
777 free(ar_temp_char);
778
779 strtolower_ar(my_copy_of_filename_ar);
780 {
781 bool achei_o_match = false;
782 const char *my_str_literal = global_patern_ar; //"* *.txt *.ini";
783 char *token, *str, *tofree;
784
785 tofree = str = strdup(my_str_literal); // We own str's memory now.
786 while ((token = strsep(&str, " ")))
787 {
788 if (strlen(token))
789 {
790 achei_o_match = strmatch(my_copy_of_filename_ar, token,
791 strlen(my_copy_of_filename_ar), strlen(token));
792 }
793 if (achei_o_match)
794 {
795 break;
796 }
797 }
798
799 free(tofree);
800
802 {
803 if (achei_o_match)
804 {
805 achei_o_match = false;
806 }
807 else
808 {
809 achei_o_match = true;
810 }
811 }
812
813 if (achei_o_match)
814 {
815 static char file_or_folder_to_process___[AMANDA__SIZE]; // = {0};
816
817 strcpy(file_or_folder_to_process___, fixo_path_ar);
818
819 if (strlen(file_or_folder_to_process___))
820 {
821 if ('\\' != file_or_folder_to_process___[strlen(file_or_folder_to_process___) - 1])
822 {
823 strcat(file_or_folder_to_process___, "\\");
824 }
825 }
826
827 strcat(file_or_folder_to_process___, entry_______i);
828 trocadordebackslashtras(file_or_folder_to_process___);
829 amanda_pereira_total_size += getfilesize_ar(file_or_folder_to_process___);
830 }
831 }
832 }
833 else
834 {
835 static char my_copy_of_filename_ar[AMANDA__SIZE];
836
837 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
838
839 strcpy(my_copy_of_filename_ar, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
840
841 free(ar_temp_char);
842
843 strtolower_ar(my_copy_of_filename_ar);
844 {
845 bool achei_o_match = false;
846 const char *my_str_literal = global_patern_ar; //"* *.txt *.ini";
847 char *token, *str, *tofree;
848 tofree = str = strdup(my_str_literal); // We own str's memory now.
849 while ((token = strsep(&str, " ")))
850 {
851 if (strlen(token))
852 {
853 achei_o_match = strmatch(my_copy_of_filename_ar, token,
854 strlen(my_copy_of_filename_ar), strlen(token));
855 }
856 if (achei_o_match)
857 {
858 break;
859 }
860 }
861
862 free(tofree);
863
865 {
866 if (achei_o_match)
867 {
868 achei_o_match = false;
869 }
870 else
871 {
872 achei_o_match = true;
873 }
874 }
875
876 if (achei_o_match)
877 {
879 }
880 }
881
883 }
884 }
885
886 while (pause_flag_ar)
887 {
888 Sleep(50);
889
890 if (fatal_exit_k)
891 {
893 break;
894 }
895 }
896
897 if (fatal_exit_k)
898 {
900 }
901 }
902 }
903
904 /*
905
906 oi_amanda_ptr->entry______i -- entrada
907 oi_amanda_ptr->whole_entry_i -- com diretorio
908
909 */
910 }
911
912 // porque nao amor?...da pelo menos pra testar isto
913
914 entrada_again_smart_ape_from_amanda:;
915
916 if (1 == 0)
917 {
918 goto entrada_again_smart_ape_from_amanda;
919 }
920
921 } while (FindNextFileW(oi_amanda_ptr->current_hFind_amanda_s_smart_____ape, &ffd) != 0);
922
923exit_me_forced_amanda_s_smart_ape:;
924
925 pedro_dprintf(IS_DEBUG_APE__, "endereco da struct na saida %p\n", oi_amanda_ptr);
926
927 pedro_dprintf(-1, "previous %p\n", oi_amanda_ptr->previous_amanda_s_smart_ape);
928
929 FindClose(oi_amanda_ptr->current_hFind_amanda_s_smart_____ape);
930
931keep_running_amanda_s_smart_ape:; // one less bug..
932
933 if (oi_amanda_ptr_inicial != oi_amanda_ptr)
934 {
935
936 pedro_dprintf(IS_DEBUG_APE__, "nao � tem que processar\n");
937 // vamos l�...debugar isto bem amor... /* here for historical reasons
938
939 assert(NULL != oi_amanda_ptr->previous_amanda_s_smart_ape);
940
941 pedro_dprintf(IS_DEBUG_APE__, "free on %x\n", oi_amanda_ptr);
942
943 to_call_free______amanda_s_smart_ape = oi_amanda_ptr;
944
945 oi_amanda_ptr = oi_amanda_ptr->previous_amanda_s_smart_ape;
946
947 if (to_call_free______amanda_s_smart_ape->entry______i)
948 {
949 free(to_call_free______amanda_s_smart_ape->entry______i);
950 to_call_free______amanda_s_smart_ape->entry______i = NULL;
951 }
952
953 if (to_call_free______amanda_s_smart_ape->whole_entry_above_i)
954 {
955 free(to_call_free______amanda_s_smart_ape->whole_entry_above_i);
956 to_call_free______amanda_s_smart_ape->whole_entry_above_i = NULL;
957 }
958
959 if (to_call_free______amanda_s_smart_ape->whole_entry_i)
960 {
961 free(to_call_free______amanda_s_smart_ape->whole_entry_i);
962 to_call_free______amanda_s_smart_ape->whole_entry_i = NULL;
963 }
964
965 free(to_call_free______amanda_s_smart_ape);
966
967 pedro_dprintf(IS_DEBUG_APE__, "novo endereco de oi_amanda_ptr %x\n", oi_amanda_ptr);
968
969 goto entrada_again_smart_ape_from_amanda;
970 }
971
972 pedro_dprintf(-1, "free final on %x\n", oi_amanda_ptr);
973
974 if (oi_amanda_ptr->entry______i)
975 {
976 free(oi_amanda_ptr->entry______i);
977 oi_amanda_ptr->entry______i = NULL;
978 }
979
980 if (oi_amanda_ptr->whole_entry_above_i)
981 {
982 free(oi_amanda_ptr->whole_entry_above_i);
983 oi_amanda_ptr->whole_entry_above_i = NULL;
984 }
985
986 if (oi_amanda_ptr->whole_entry_i)
987 {
988 free(oi_amanda_ptr->whole_entry_i);
989 oi_amanda_ptr->whole_entry_i = NULL;
990 }
991
992 free(oi_amanda_ptr);
993
994no_entries_i:;
995
996 return 0;
997}
998
#define FILE_ATTRIBUTE_DIRECTORY
Definition 7zTypes.h:146
#define AMANDA__SIZE
Definition arp.h:149
amanda__mode
Definition arp.h:238
@ I_MODE_IS_ENUMFOLDER_1
Definition arp.h:240
@ I_MODE_IS_SCANFOLDER
Definition arp.h:239
@ ARP_EXCLUDE_FILES
Definition arp_2.h:6
wchar_t * permissive_name_m_(const wchar_t *wname, WCHAR *ar_temp)
Definition tar_1_33.c:279
int size_of_WCHAR_mem_r(char *in_string)
Definition tar_1_33.c:694
void pedro_dprintf(int amanda_level, char *format,...)
Definition pedro.c:43
WCHAR * amanda_asciitowide_1_(char *pUTF8, WCHAR *ar_temp)
Definition tar_1_33.c:677
char warning_flag
Definition create_zen_ar.c:354
void add_more_one(char *data_ar)
Definition create_zen_ar.c:383
int files_that_cannot_be_read_update
Definition create_zen_ar.c:312
void get_timestamp_arp(char *file_arp, __time64_t *s_arp, VAL_data *VAL_data_arp)
Definition tar_1_33.c:3939
void dump_file_new_ar(struct tar_stat_info *parent, char const *name, char *initial_path_ar)
Definition create_zen_ar.c:2432
int64_t folders_count
Definition create_zen_ar.c:357
__int64 ricard0_itens_processed
Definition create_zen_ar.c:2568
void strtolower_ar(char *path)
Definition create_zen_ar.c:669
__int64 amanda_itens
Definition create_zen_ar.c:2567
char fixo_path_ar[AMANDA__SIZE]
Definition create_zen_ar.c:2545
char pause_flag_ar
Definition create_zen_ar.c:353
int64_t amanda_pereira_total_size
Definition create_zen_ar.c:340
enum mode_is_include_or_exclude mode_is_include_or_exclude__
Definition create_zen_ar.c:349
bool strmatch(char str[], char pattern[], int n, int m)
Definition create_zen_ar.c:2493
bool is_valid__Pk_folder(char *the_path_k__p)
Definition enum_files_and_folders_1.c:57
#define THE_SIZE_I
#define IS_DEBUG_APE__
Definition enum_files_and_folders_1.c:32
int amanda_s_smart_ape(__attribute__((unused)) char *initial_path_amanda_s_smart_ape, bool recurse_on_subfolders_amanda_s_smart_ape, enum amanda__mode amanda_mode, __attribute__((unused)) bool is_callback)
Definition enum_files_and_folders_1.c:158
char whole_entry_i[AMANDA__SIZE]
Definition enum_files_and_folders_1.c:55
bool cancel_me_amanda_smart_ape
Definition enum_files_and_folders_1.c:52
void get_file_time_pk(char *file_or_folder_to_process, char *timestamp_pk)
Definition enum_files_and_folders_1.c:72
char entry_______i[AMANDA__SIZE]
Definition enum_files_and_folders_1.c:54
void trocadordebackslashtras(char *path)
Definition extract_kkk.c:2087
int __stdcall check_item_z_june_24(char *filename_utf8)
Definition libarchive_update_i.c:203
void __stdcall add_more_one_z_june_24(time_t atime_i, time_t mtime_i, time_t birthtime_i, int64_t filesize_i, int64_t file_offset_i, char *item_entry_i, bool is_dir_i, bool in_use_i, int64_t attributes_i)
Definition libarchive_update_i.c:79
#define assert(condition)
Definition lz4.c:273
#define __attribute__(unused_ric_since_2004)
Definition main_cr.c:84
__int64 getfilesize_ar(char *infile_ar)
Definition tar_1_33.c:2432
Definition 7zMain.c:324
Definition arp.h:153
Definition enum_files_and_folders_1.c:40
struct oi_amanda * next_amanda_s_smart_ape
Definition enum_files_and_folders_1.c:45
char * whole_entry_above_i
Definition enum_files_and_folders_1.c:43
HANDLE current_hFind_amanda_s_smart_____ape
Definition enum_files_and_folders_1.c:49
struct oi_amanda * previous_amanda_s_smart_ape
Definition enum_files_and_folders_1.c:46
char * whole_entry_i
Definition enum_files_and_folders_1.c:42
struct oi_amanda * subfolder_amanda_s_smart_ape
Definition enum_files_and_folders_1.c:47
char * entry______i
Definition enum_files_and_folders_1.c:41
HANDLE parent_hFind_amanda_s_smart______ape
Definition enum_files_and_folders_1.c:48
char * strsep(char **stringp, const char *delim)
Definition tar_1_33.c:7425
char file_got_pk[1024]
Definition tar_1_33.c:88
__time64_t atime_i
Definition tar_1_33.c:151
char global_patern_ar[20000]
Definition tar_1_33.c:621
int Year_k
Definition tar_1_33.c:2960
int Hour_k
Definition tar_1_33.c:2953
int Minute_k
Definition tar_1_33.c:2955
__time64_t ctime_i
Definition tar_1_33.c:152
bool mode_is_VAL_arp
Definition tar_1_33.c:594
char * valquiria_wide_to_utf8(WCHAR *pUSC2_maria, char *ar_temp_char)
Definition tar_1_33.c:766
bool only_get_number_of_files_ar_v27
Definition tar_1_33.c:120
int Month_k
Definition tar_1_33.c:2956
int Second_k
Definition tar_1_33.c:2959
int Day_k
Definition tar_1_33.c:2952
FILE * my___temp_file_i
Definition tar_1_33.c:142
bool is_update_i
Definition tar_1_33.c:159
bool true_if_include_i
Definition tar_1_33.c:11018
meu_fn_pk meu_fn_pk_
Definition tar_1_33.c:95
__time64_t mtime_i
Definition tar_1_33.c:153
int64_t attributes_i
Definition tar_1_33.c:147
char date_got_pk[1024]
Definition tar_1_33.c:89
int fatal_exit_k
Definition tar_1_33.c:3217
#define NULL
Definition getopt1.c:37
const char * str
Table column heading string.
Definition list.c:109