3.2.4.13 Application Requests Setting File Attributes

The application provides:

  • A valid Client.Session.

  • The Client.TreeConnect representing the share in which the file to be accessed exists.

  • If the file is not open, the full pathname relative to Client.TreeConnect.ShareName. Otherwise, attributes SHOULD be set using a valid Client.Open representing the opened file.

  • The Information Level that defines the format of the data to set, as specified in [MS-FSCC] section 2.4.

  • When the Information Level is SMB_INFO_STANDARD, the application provides the creation date and time, last access date and time and last write date and time of the file, all expressed as the number of seconds from January 1, 1970 00:00:00.0.

  • When the Information Level is SMB_INFO_EAS, the application provides the extended attribute name/value pairs of the file.

  • When the Information Level is SMB_SET_FILE_BASIC_INFO, the application provides the creation time, last access time, last write time, change time and extended attribute name/pair of the file.

  • When the Information Level is SMB_SET_FILE_DISPOSITION_INFO, the application provides a Boolean to indicate if the file is marked for deletion.

  • When the Information Level is SMB_SET_FILE_ALLOCATION_INFO, the application provides the file allocation size in bytes.

  • When the Information Level is SMB_SET_FILE_END_OF_FILE_INFO, the application provides the offset from the beginning of the file to the byte following the last byte in the file.

The client can use any of the following commands to set file attributes. The SMB_COM_SET_INFORMATION (section 2.2.4.10) and SMB_COM_SET_INFORMATION2 (section 2.2.4.30) commands are deprecated; the client SHOULD use the TRANS2_SET_PATH_INFORMATION (section 2.2.6.7) or the TRANS2_SET_FILE_INFORMATION (section 2.2.6.9) transaction subcommand. The transaction subcommands can also be used to set named pipe attributes. The client MUST map the application-provided Information Level to the Set Information Levels, as specified in section 2.2.8.

  • SMB_COM_SET_INFORMATION (deprecated)

    The client MUST construct the SMB_COM_SET_INFORMATION Request (section 2.2.4.10.1) as defined in section 2.2.4.10. This command can be used to set basic SMB_FILE_ATTRIBUTES (section 2.2.1.2.4), and to set the last write time attribute of the file. The file to be modified MUST be identified by a full pathname, relative to the TID.

  • SMB_COM_SET_INFORMATION2 (section 2.2.4.30) (deprecated)

    The client MUST construct the SMB_COM_SET_INFORMATION2 Request (section 2.2.4.30.1) as defined in section 2.2.4.30. This command can be used to set the creation time, last access time, and last write time attributes of the file. This command does not support modification of SMB_FILE_ATTRIBUTES. The file to be modified MUST be identified by a FID (an open file handle).

  • TRANS2_SET_PATH_INFORMATION

    When the Information Level is SMB_INFO_STANDARD, the application provides:

    • The creation date of the file.

    • The creation time of the file.

    • The last access date of the file.

    • The last access time of the file.

    • The last write date of the file.

    • The last write time of the file.

      When the Information Level is SMB_INFO_EAS, the application provides:

    • The extended attribute name/value pairs of the file.

      When the Information Level is SMB_SET_FILE_BASIC_INFO, the application provides:

    • The creation date and time of the file.

    • The last access date and time of the file.

    • The last write date and time of the file.

    • The change date and time of the file.

    • The extended attribute name/value pairs of the file.

      When the Information Level is SMB_SET_FILE_DISPOSITION_INFO, the application provides:

    • A Boolean flag indicating whether the file is to be deleted when closed.

      When the Information Level is SMB_SET_FILE_ALLOCATION_INFO, the application provides:

    • The allocation size of the file in bytes.

      When the Information Level is SMB_SET_FILE_END_OF_FILE_INFO, the application provides:

    • The absolute new end-of-file position as a byte offset from the start of the file.

      The client MUST construct the TRANS2_SET_PATH_INFORMATION (section 2.2.6.7) subcommand request as defined in section 2.2.6.7. The TRANS2_SET_PATH_INFORMATION Request (section 2.2.6.7.1) MUST be transported to the server using the Transaction2 subprotocol. This subcommand can be used to:

    • Set SMB_FILE_ATTRIBUTES on the file.

    • Set the creation time, last access time, and last write time attributes of the file.

    • Set extended attribute (EA) name/value pairs.

    • Set the delete-on-close state of a file.

    • Change the allocated size of the file.

      The file to be modified MUST be identified by a full pathname, relative to the TID.

  • TRANS2_SET_FILE_INFORMATION

    This transaction subcommand is identical in behavior to TRANS2_SET_PATH_INFORMATION, except that the file MUST be identified by FID rather than by pathname.

The request MUST be sent to the server as specified in section 3.2.4.1.