File src/fileops.c changed (mode: 100644) (index 4ec37773c..1086d4251) |
... |
... |
make_dirs(FileView *view, char **names, int count, int create_parent) |
3569 |
3569 |
int n; |
int n; |
3570 |
3570 |
void *cp = (void *)(long)create_parent; |
void *cp = (void *)(long)create_parent; |
3571 |
3571 |
|
|
|
3572 |
|
for(i = 0; i < count; i++) |
|
3573 |
|
{ |
|
3574 |
|
struct stat st; |
|
3575 |
|
if(is_in_string_array(names, i, names[i])) |
|
3576 |
|
{ |
|
3577 |
|
status_bar_errorf("Name \"%s\" duplicates", names[i]); |
|
3578 |
|
return; |
|
3579 |
|
} |
|
3580 |
|
if(names[i][0] == '\0') |
|
3581 |
|
{ |
|
3582 |
|
status_bar_errorf("Name #%d is empty", i + 1); |
|
3583 |
|
return; |
|
3584 |
|
} |
|
3585 |
|
if(lstat(names[i], &st) == 0) |
|
3586 |
|
{ |
|
3587 |
|
status_bar_errorf("File \"%s\" already exists", names[i]); |
|
3588 |
|
return; |
|
3589 |
|
} |
|
3590 |
|
} |
|
3591 |
|
|
3572 |
3592 |
snprintf(buf, sizeof(buf), "mkdir in %s: ", |
snprintf(buf, sizeof(buf), "mkdir in %s: ", |
3573 |
3593 |
replace_home_part(view->curr_dir)); |
replace_home_part(view->curr_dir)); |
3574 |
3594 |
|
|
|
... |
... |
make_files(FileView *view, char **names, int count) |
3616 |
3636 |
} |
} |
3617 |
3637 |
if(names[i][0] == '\0') |
if(names[i][0] == '\0') |
3618 |
3638 |
{ |
{ |
3619 |
|
status_bar_error("One of names is empty"); |
|
|
3639 |
|
status_bar_errorf("Name #%d is empty", i + 1); |
3620 |
3640 |
return 1; |
return 1; |
3621 |
3641 |
} |
} |
3622 |
3642 |
if(strchr(names[i], '/') != NULL) |
if(strchr(names[i], '/') != NULL) |