+ g_ptr_array_add(argv_ptr, stralloc(star_path));
+ if (star_directory) {
+ struct stat stat_buf;
+ if(stat(star_directory, &stat_buf) != 0) {
+ fprintf(stderr,"can not stat directory %s: %s\n", star_directory, strerror(errno));
+ exit(1);
+ }
+ if (!S_ISDIR(stat_buf.st_mode)) {
+ fprintf(stderr,"%s is not a directory\n", star_directory);
+ exit(1);
+ }
+ if (access(star_directory, W_OK) != 0 ) {
+ fprintf(stderr, "Can't write to %s: %s\n", star_directory, strerror(errno));
+ exit(1);
+ }
+
+ g_ptr_array_add(argv_ptr, stralloc("-C"));
+ g_ptr_array_add(argv_ptr, stralloc(star_directory));
+ }
+ g_ptr_array_add(argv_ptr, stralloc("-x"));
+ g_ptr_array_add(argv_ptr, stralloc("-v"));
+ g_ptr_array_add(argv_ptr, stralloc("-xattr"));
+ g_ptr_array_add(argv_ptr, stralloc("-acl"));
+ g_ptr_array_add(argv_ptr, stralloc("errctl=WARN|SAMEFILE|SETTIME|DIFF|SETACL|SETXATTR|SETMODE|BADACL *"));
+ g_ptr_array_add(argv_ptr, stralloc("-no-fifo"));
+ g_ptr_array_add(argv_ptr, stralloc("-f"));
+ g_ptr_array_add(argv_ptr, stralloc("-"));
+
+ if (argument->dle.exclude_list &&
+ argument->dle.exclude_list->nb_element == 1) {
+ g_ptr_array_add(argv_ptr, stralloc("-exclude-from"));
+ g_ptr_array_add(argv_ptr,
+ stralloc(argument->dle.exclude_list->first->name));
+ }
+
+ if (argument->dle.include_list &&
+ argument->dle.include_list->nb_element == 1) {
+ g_ptr_array_add(argv_ptr,
+ stralloc2("list=",
+ argument->dle.include_list->first->name));
+ }