Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
DosSetFileInfo (1.2)
◄Function Group► ◄Overview► ◄Changes► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_DOSFILEMGR
USHORT DosSetFileInfo(hf, usInfoLevel, pInfoBuf, cbInfoBuf)
HFILE hf; /* handle of file about which data is sought */
USHORT usInfoLevel; /* level of file data required */
PBYTE pInfoBuf; /* pointer to file-data buffer */
USHORT cbInfoBuf; /* length of file-data buffer */
The DosSetFileInfo function sets information about a specific file. The file
information consists of the date and time the file was created, the date and
time it was last accessed, the date and time it was last written to, the
size of the file, and its attributes. It can also be used to set extended
attributes for a file.
The DosSetFileInfo function is a family API function.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hf Identifies the file about which information is to be set. This
handle must have been created by using the DosOpen function.
usInfoLevel Specifies the level of file information. This may be one of the
following values:
Value Meaning
───────────────────────────────────────────────────────────────
FIL_STANDARD This uses a FILESTATUS structure. Any date and
time fields in this structure that the file
system does not support should be set to zero.
FIL_EAOP This uses an EAOP structure, which contains the
file's extended-attribute information.
pInfoBuf Points to the structure that contains the file information.
This structure will be FILESTATUS or EAOP, depending on the
usInfoLevel parameter.
cbInfoBuf Specifies the length (in bytes) of the buffer that contains the
file information.
Return Value
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
ERROR_BUFFER_OVERFLOW
ERROR_DIRECT_ACCESS_HANDLE
ERROR_EA_LIST_INCONSISTENT
ERROR_INVALID_EA_NAME
ERROR_INVALID_HANDLE
ERROR_INVALID_LEVEL
Comments
DosSetFileInfo works only for files opened in a mode that allows write
access.
Prior to the function being called, the fpFEAlist field in the EAOP
structure should be initialized so that it points to the FEALIST structure
that contains the relevant FEA structure. The cbList field in the FEALIST
structure is valid, giving the size of the FEA structure.
A zero value in both the date and time components of a field causes that
field to be unchanged. For example, if both the fdateLastWrite and
ftimeLastWrite fields are zero in the FILESTATUS structure, both attributes
of the file remain unchanged. If either of these fields are nonzero, both
attributes of the file are set to the new values. If extended attributes are
modified, the file's last modification date and time are changed.
See Also
DosBufReset, DosClose, DosNewSize, DosOpen, DosSetFileMode, DosQFileInfo,
EAOP, FEA, FEALIST, FILESTATUS
♦