SetFileInfo

Sets file information for a file

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.x, 4.x, 5.x, 6.x
Platform:NLM
Service:File System

Syntax

   #include <nwfinfo.h>  
    
   int SetFileInfo  (  
      char  *filePath,   
      BYTE   searchAttributes,   
      LONG   fileAttributes,   
      char  *creationDateAndTime,   
      char  *lastAccessDate,   
      char  *lastUpdateDateAndTime,   
      char  *lastArchiveDateAndTime,   
      LONG   fileOwnerID);
   

Parameters

filePath

(IN) Points to the string containing the path specification of the file to be changed (maximum 255 characters, including the NULL terminator).

searchAttributes

(IN) Specifies the type of the file for which to set file information.

fileAttributes

(IN) Specifies the file attributes to be assigned to the file.

creationDateAndTime

(IN) Points to the creation date and time to be assigned to the file (DOS format, 4 bytes).

lastAccessDate

(IN) Points to the last access date to be assigned to the file (DOS format, bytes 1 and 2).

lastUpdateDateAndTime

(IN) Points to the last update date and time to be assigned to the file (DOS format, 4 bytes).

lastArchiveDateAndTime

(IN) Points to the last archived date and time to be assigned to the file (DOS format, 4 bytes).

fileOwnerID

(IN) Specifies the unique object ID to be assigned as the new owner.

Return Values

0

0x00

ESUCCESS

NetWare Error

UNSUCCESSFUL

Remarks

SetFileInfo sets file information by passing the file path, the search attributes byte, and specific file information. File information includes file attributes, extended file attributes, creation date and time, last access date, last update date and time, file owner, and last archived date and time.

SetFileInfo expects the date and time to be in DOS format. The date and time field from readdir is not in the DOS date/time format but can be used by swapping the high word with the low word.

SetFileInfo requires that the requesting workstation have Supervisor rights to the file(s) being modified.

The filePath parameter can specify an absolute or a relative path. An absolute file path appears in the following format:

   volume: directory1\...\directory\file name
   

A relative file path includes a file name and (optionally) one or more antecedent directory names.

A file name can be from 1 to 8 characters long and can include a 1- to 3-character extension. All letters must be upper case. The last item in the filePath parameter must be a valid file name specification. No wildcard specifiers are allowed.

The searchAttributes parameter can have the following values:

0x00

Normal files

0x02

Normal and hidden files

0x04

Normal and system files

0x06

Normal, hidden, and system files

SetFileInfo can assign file attributes to a specified file by passing a new value in the fileAttributes parameter. The following bits are defined for byte 0:

The following bits are defined for byte 1, the extended attributes byte:

In NetWare 3.0 and above, you can set four file attributes in byte 2, bits 0, 1, 2, and 4. In NetWare 4.x, 5.x, and 6.x, you can set bit 7:

NetWare 4.x, 5.x, and 6.x also allow you to set file attributes in an additional byte, byte 3:

The creationDateAndTime, lastUpdateDateAndTime, and lastArchiveDateAndTime parameters occupy bytes 0, 1, 2, and 3.

The application can change the owner of the file by passing the object ID number of the new owner in the fileOwnerID parameter.

The SetCurrentNameSpace function sets the name space which is used for parsing the path input to SetFileInfo.

See Also

NWSetDirEntryInfo, readdir