Share via


2.4.43 FileRenameInformationEx

This information class is used to rename a file.

A FILE_RENAME_INFORMATION_EX data element, defined as follows, is provided by the client.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Flags

Reserved

RootDirectory

...

FileNameLength

FileName (variable)

...

Padding (variable)

...

Flags (4 bytes): A 32-bit field that specifies options on how the file is renamed.

This field contains one or more of the values in the following table.

Value

Meaning

FILE_RENAME_REPLACE_IF_EXISTS

0x00000001

If set, indicates that if a file with the given name already exists, it SHOULD be replaced with the given file. If not set, indicates that the rename operation MUST fail if a file with the given name already exists.

FILE_RENAME_POSIX_SEMANTICS

0x00000002

If set and FILE_RENAME_REPLACE_IF_EXISTS is set, indicates that if a file with the given name already exists the file SHOULD be deleted using POSIX-style semantics. Existing handles to the replaced file continue to be valid. Any subsequent opens of the target name will open the renamed file, not the replaced file.

FILE_RENAME_SUPPRESS_PIN_STATE_INHERITANCE

0x00000004

If set, when renaming a file to a new directory, suppress any inheritance rules related to the FILE_ATTRIBUTE_PINNED and FILE_ATTRIBUTE_UNPINNED attributes.<146>

FILE_RENAME_SUPPRESS_STORAGE_RESERVE_INHERITANCE

0x00000008

If set, when renaming a file to a new directory, it suppresses any inheritance rules related to the storage reserve ID property of the file.<147>

FILE_RENAME_NO_INCREASE_AVAILABLE_SPACE

0x00000010

If set and FILE_RENAME_SUPPRESS_STORAGE_RESERVE_INHERITANCE is not set; when renaming a file to a new directory, automatically resize affected storage reserve areas as needed to prevent the user visible free space on the volume from increasing. Requires manage volume access.<148>

FILE_RENAME_NO_DECREASE_AVAILABLE_SPACE

0x00000020

if set and FILE_RENAME_SUPPRESS_STORAGE_RESERVE_INHERITANCE is not set; when renaming a file to a new directory, automatically resize affected storage reserve areas as needed to prevent the user visible free space on the volume from decreasing. Requires manage volume access.<149>

FILE_RENAME_PRESERVE_AVAILABLE_SPACE

0x00000030

Equivalent to specifying both FILE_RENAME_NO_INCREASE_AVAILABLE_SPACE and FILE_RENAME_NO_DECREASE_AVAILABLE_SPACE.<150>

FILE_RENAME_IGNORE_READONLY_ATTRIBUTE

0x00000040

If set and FILE_RENAME_REPLACE_IF_EXISTS is set; allow replacing a file even if the read-only attribute is set on the file.<151>

FILE_RENAME_FORCE_RESIZE_TARGET_SR

0x00000080

If set and FILE_RENAME_SUPPRESS_STORAGE_RESERVE_INHERITANCE is not set; when renaming a file to a new directory that is part of a different storage reserve area, always grow the target directory's storage reserve area by the full size of the file being renamed. Requires manage volume access.<152>

FILE_RENAME_FORCE_RESIZE_SOURCE_SR

0x00000100

If set and FILE_RENAME_SUPPRESS_STORAGE_RESERVE_INHERITANCE is not set; when renaming a file to a new directory that is part of a different storage reserve area, always shrink the source directory's storage reserve area by the full size of the file being renamed. Requires manage volume access.<153>

FILE_RENAME_FORCE_RESIZE_SR

0x00000180

Equivalent to specifying both FILE_RENAME_FORCE_RESIZE_TARGET_SR and FILE_RENAME_FORCE_RESIZE_SOURCE_SR.<154>

Reserved (4 bytes): Reserved area for alignment. This field can contain any value and MUST be ignored.

RootDirectory (8 bytes): A 64-bit unsigned integer that contains the file handle for the directory to which the new name of the file is relative. For network operations, this value MUST always be zero.

FileNameLength (4 bytes): A 32-bit unsigned integer that specifies the length, in bytes, of the file name contained within the FileName field.

FileName (variable): A sequence of Unicode characters containing the new name of the file. When working with this field, use FileNameLength to determine the length of the file name rather than assuming the presence of a trailing null delimiter.

Padding (variable): Length of this field MUST be the number of bytes required to make the size of this structure at least 24. This field MAY be set to 0 and MUST be ignored on receipt.