Предыдущая тема :: Следующая тема |
Автор |
Сообщение |
Anatoliy
Зарегистрирован: 15.04.2002 Сообщения: 681 Откуда: Moscow
|
Добавлено: Ср Мар 13 2002 09:41 Заголовок сообщения: подскажите, информация о файле С++В |
|
|
С помощью какой процедуры, можно получить о файле информацию - дата создания - изменения - открытия - размер - имя |
|
Вернуться к началу |
|
|
IL
Зарегистрирован: 21.05.2002 Сообщения: 19 Откуда: Ryazan
|
Добавлено: Ср Мар 13 2002 10:29 Заголовок сообщения: Re: подскажите, информация о файле С++В |
|
|
#include int fstat(int handle, struct stat *statbuf); int stat(const char *path, struct stat *statbuf); int _wstat(const wchar_t *path, struct stat *statbuf);
Description
Gets open file information.
fstat stores information in the stat structure about the file or directory associated with handle.
stat stores information about a given file or directory in the stat structure. The name of the file is path.
statbuf points to the stat structure (defined in sys\stat.h). That structure contains the following fields:
st_mode Bit mask giving information about the file's mode st_dev Drive number of disk containing the file or file handle if the file is on a device st_rdev Same as st_dev st_nlink Set to the integer constant 1 st_size Size of the file in bytes st_atime Most recent access (Windows) or last time modified (DOS) st_mtime Same as st_atime st_ctime Same as st_atime
The stat structure contains three more fields not mentioned here. They contain values that are meaningful only in UNIX.
The st_mode bit mask that gives information about the mode of the open file includes the following bits:
One of the following bits will be set:
S_IFCHR If handle refers to a device. S_IFREG If an ordinary file is referred to by handle.
One or both of the following bits will be set:
S_IWRITE If user has permission to write to file. S_IREAD If user has permission to read to file.
The HPFS and NTFS file-management systems make the following distinctions:
st_atime Most recent access st_mtime Most recent modify st_ctime Creation time
Return Value
fstat and stat return if they successfully retrieved the information about the open file.
On error (failure to get the information) these functions return -1 and set the global variable errno to
EBADF Bad file handle |
|
Вернуться к началу |
|
|
ilya Гость
|
Добавлено: Ср Мар 13 2002 11:24 Заголовок сообщения: CFile::GetStatus |
|
|
Сначала открыть и т.д. |
|
Вернуться к началу |
|
|
|