mình có đọc bài trong diễn đàn thấy có hàm CHDIR chỉ biết là nó thay đổi từ thư mục hiện thời sang một thư mục mới được chỉ ra theo path.
http://forums.congdongcviet.com/showthread.php?p=46356
mình không hiểu code này nó định làm gì nữa
PHP Code:
#include <stdio.h>
#include <stdlib.h>
#include <dir.h>
char old_dir[MAXDIR];
char new_dir[MAXDIR];
int main(void){
if (getcurdir(0, old_dir)){
perror("getcurdir()");
exit(1);
}
printf("Current directory is: \\%s\n", old_dir);
if (chdir("\\")){
perror("chdir()");
exit(1);
}
if (getcurdir(0, new_dir)){
perror("getcurdir()");
exit(1);
}
printf("Current directory is now: \\%s\n", new_dir);
printf("\nChanging back to orignal directory: \\%s\n", old_dir);
if (chdir(old_dir)){
perror("chdir()");
exit(1);
}
return 0;
}
chỗ này
Code:
#include <stdio.h>
#include <stdlib.h>
#include <dir.h>
char old_dir[MAXDIR];
char new_dir[MAXDIR];
int main(void){
if (getcurdir(0, old_dir)){
perror("getcurdir()");
exit(1);
}
printf("Current directory is: \\%s\n", old_dir);
if (chdir("\\")){
chõ mầu đỏ nghĩa là gì thế
cái câu hướng dẫn là thay đổi từ thư mục hiện thời sang thư mục khác nghe nó mông lung quá,ai có thể nói cụ thể là thay đồi gì cho mình không