ºìÁªLinuxÃÅ»§
Linux°ïÖú

LinuxĿ¼Ïà¹Øº¯Êý

·¢²¼Ê±¼ä:2007-11-12 00:52:24À´Ô´:ºìÁª×÷Õß:CDflexaz


//»ñÈ¡µ±Ç°¹¤×÷Ŀ¼
char* getcwd(char* buffer, size_t size);

//»ñȡϵͳĿ¼×î´ó³¤¶È
long pathconf(char* path, int flag);

//¸ü¸Äµ±Ç°¹¤×÷Ŀ¼
int chdir(const char* path);
int fchdir(int fd);

//sample
/*¸ü¸Äµ±Ç°¹¤×÷Ŀ¼µ½Éϼ¶Ä¿Â¼*/
if(chdir("..")==-1){
perror("Couldn't change current working directory.\n");
return 1;
}

//´´½¨ºÍɾ³ýĿ¼
#include
#include
int mkdir(const char* pathname, mode_t mode);

#include
int rmdir(const char* pathname);

/*mode ÉèÖÃΪ0700£¬¿ªÊ¼µÄ0±íʾ°Ë½øÖÆ*/
if(mkdir("/home/zxc/z", 0700) == -1){
perror("Couldn't create the directory.\n");
return 1;
}

//»ñµÃÎļþÐÅÏ¢
#include
int stat(const char* path, struct stat* buf);
int fstat(int filedes, struct stat* buf);
int lstat(const char* path, struct stat* buf); //ÐÞ¸ÄÎļþȨÏÞ int chmod(const char* path, mode_t mode); int fchmod(int fd, mode_t mode); //ÐÞ¸ÄÎļþµÄËùÓÐÕß int chown(const char* path, uid_t owner, gid_t group); int fchown(int fd, uid_t owner, gid_t group); int lchown(const char* path, uid_t owner, gid_t group); //umask()ÓÃÓÚÓ°Ïìд´½¨µÄÎļþµÄÊôÐÔ£¬Ð´´½¨µÄÎļþÊôÐÔΪ666£­mask£¬Ð´´½¨µÄĿ¼ÊôÐÔΪ777£­mask mode_t umask(mode_t mask) #include int link(const char* oldpath, const char* newpath);//´´½¨Ó²Á´½Ó ln file.dat link int symlink(const char* oldpath, const char* newpath);//´´½¨·ûºÅÁ´½Ó ln -s file.dat link.2 int unlink(const char* pathname);
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ