Содержание
- 2. ЦЕЛИ РАЗДЕЛА По окончании этого раздела вы сможете: определить доступность файла определить состояние файла изменить права
- 3. access(2) ИСПОЛЬЗОВАНИЕ #include int access (const char *path, int amode); ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ успех - 0 неуспех
- 4. Флаги access(2) R_OK чтение W_OK изменение X_OK исполнение (поиск) F_OK существование
- 5. ulimit(2) ИСПОЛЬЗОВАНИЕ #include long ulimit (int cmd,.../* newlimit */); ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ успех - неотрицательное число неуспех
- 6. Команды ulimit(2) UL_GETFSIZE Возвращает текущее ограничение процесса на размер файла. UL_SETFSIZE Устанавливает ограничение на размер файла.
- 7. umask(2) ИСПОЛЬЗОВАНИЕ #include #include mode_t umask (mode_t cmask); ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ предыдущее значение маски создания файла
- 8. stat(2) ИСПОЛЬЗОВАНИЕ #include #include int stat (const char *path, struct stat *buf); int lstat(const char *path,
- 9. struct stat sys/stat.h: struct stat { dev_t st_dev; ino_t st_ino; mode_t st_mode; nlink_t st_nlink; uid_t st_uid;
- 10. getpwent(3C) ИСПОЛЬЗОВАНИЕ #include struct passwd *getpwent (void); struct passwd *getpwuid (uid_t uid); struct passwd *getpwnam (const
- 11. struct passwd struct passwd { char *pw_name; char *pw_passwd; uid_t pw_uid; gid_t pw_gid; char *pw_age; char
- 12. getgrent(3C) ИСПОЛЬЗОВАНИЕ #include struct group *getgrent (void); struct group *getgrgid (gid_t gid); struct group *getgrnam (char
- 13. chmod(2) ИСПОЛЬЗОВАНИЕ #include #include int chmod (const char *path, mode_t mode); int fchmod(int fildes, mode_t mode);
- 14. chown(2) ИСПОЛЬЗОВАНИЕ #include #include int chown (const char *path, uid_t owner, gid_t group); int lchown(const char
- 15. utime(2) ИСПОЛЬЗОВАНИЕ #include #include int utime (const char *path, const struct utimbuf *times); ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ успех
- 16. truncate(3C) ИСПОЛЬЗОВАНИЕ #include int truncate(char *path, off_t length); int ftruncate(int fildes, off_t length); ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ успех
- 17. pathfind(3G) ИСПОЛЬЗОВАНИЕ gcc -lgen #include char *pathfind(const char *path, const char *name, const char *mode); ВОЗВРАЩАЕМОЕ
- 19. Скачать презентацию