|
|
|
Как переместить файлы с одной директории в другую
|
|||
|---|---|---|---|
|
#18+
Хочу переместить файлы с одной директории в другую. Написал функцию, но она что-то не работает. Не могу понять ПОЧЕМУ ??? Помогите найти ошибки. ---------------------------------------------------- int FileMoveDir(char* path_to_dir_s, char* path_to_dir_d) { char *str = path_to_dir_s; char *f1 = path_to_dir_s; char *f2 = path_to_dir_d; f1 = strcat(f1,"\\"); f2 = strcat(f2,"\\"); if (strchr(str,strlen(str))=="\\") { strcat(str,"*.*"); } else { strcat(str,"\\"); strcat(str,"*.*"); } WIN32_FIND_DATA ffblk; HANDLE hFF; int res = 0; hFF = FindFirstFile(str,&ffblk); while (GetLastError()!= ERROR_NO_MORE_FILES) { if (ffblk.dwFileAttributes!=FILE_ATTRIBUTE_DIRECTORY) { f1 = path_to_dir_s; f2 = path_to_dir_d; strcat(f1,"\\"); strcat(f2,"\\"); res = MoveFile(strcat(f1,ffblk.cFileName),strcat(f2,ffblk.cFileName)); } FindNextFile(hFF,&ffblk); } return res; } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.06.2006, 00:18 |
|
||
|
Как переместить файлы с одной директории в другую
|
|||
|---|---|---|---|
|
#18+
а что дебагер - это уже не модно? ну вот эти строчки подозрительны: strcat(str,"\\"); strcat(str,"*.*"); ------------------ - А как в Интеpнете pаботать? - Сначала нужно узнать, что вам нужно rtfm ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.06.2006, 01:30 |
|
||
|
|

start [/forum/search_topic.php?author=kiLLpiLL&author_mode=last_topics&do_search=1]: |
0ms |
get settings: |
6ms |
get forum list: |
11ms |
get settings: |
5ms |
get forum list: |
14ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
42ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
39ms |
get tp. blocked users: |
1ms |
| others: | 654ms |
| total: | 789ms |

| 0 / 0 |
