FS_RenameFile( PIOREQ pir )
A file is renamed through FS_RenameFile. This routine handles the Win32 function: MoveFile(); and int 21h functions: 17h, and 56h.
ir_ppath
Supplies a pointer to the canonicalized unicode source pathname to be renamed. The pathname may contain wildcards only if it is a 8.3 pathname. Long filename paths will not contain wildcards.
ir_rh
Supplies handle to disk volume or network resource which contains the file.
ir_attr
Supplies wildcard search attributes and advisory path parsing flags for the source path.
Search Attribute Values: Any combination of the following attributes may be specified, causing those files to be included with normal files in the search. | |
Value | Meaning |
FILE_ATTRIBUTE_HIDDEN | Include hidden file in search. |
FILE_ATTRIBUTE_SYSTEM | Include system file in search. |
FILE_ATTRIBUTE_DIRECTORY | Include subdirectories in search. The following attribute will only be specified by itself. It will not be combined with any of the other attributes. |
FILE_ATTRIBUTE_VOLUMELABEL | Search for volume label only. |
Path Parsing Flags: The following path parsing flags are passed in. | |
Value | Meaning |
FILE_FLAG_WILDCARDS | Wildcard characters present in pathname. |
FILE_FLAG_LONG_PATH | Path has a longname component. |
FILE_FLAG_KEEP_CASE | Preserve the case of the filename passed in when storing on disk. This also implies that this call should use longname semantics for its processing. |
FILE_FLAG_HAS_DOT | Filename component has a dot in its name. |
FILE_FLAG_IS_LFN | Filename component is a longname. |
ir_ppath2
Supplies a pointer to the canonicalized unicode destination pathname to rename to.
ir_attr2
Supplies wildcard search attributes and advisory path parsing flags for the destination path.
Search Attribute Values: Any combination of the following attributes may be specified, causing those files to be included with normal files in the search. | |
Value | Meaning |
FILE_ATTRIBUTE_HIDDEN | Include hidden file in search. |
FILE_ATTRIBUTE_SYSTEM | Include system file in search. |
FILE_ATTRIBUTE_DIRECTORY | Include subdirectories in search. The following attribute will only be specified by itself. It will not be combined with any of the other attributes. |
FILE_ATTRIBUTE_VOLUMELABEL | Search for volume label only. |
Path Parsing Flags: The following path parsing flags are passed in. | |
Value | Meaning |
FILE_FLAG_WILDCARDS | Wildcard characters present in pathname. |
FILE_FLAG_LONG_PATH | Path has a longname component. |
FILE_FLAG_KEEP_CASE | Preserve the case of the filename passed in when storing on disk. This also implies that this call should use longname semantics for its processing. |
FILE_FLAG_HAS_DOT | Filename component has a dot in its name. |
FILE_FLAG_IS_LFN | Filename component is a longname. |
ir_ptuninfo
Supplies a pointer to a tunnelling structure. A NULL pointer is passed in this field if there is no tunnelling information. The tunnelling structure is described below.
Tunnelling Structure: | |
Value | Meaning |
tuni_bfContents | Specifies flags for the tunnelling information passed in. |
Tunnelling Info Flag Values: | |
Value | Meaning |
TUNI_CONTAINS_ALTNAME | Alternate unicode name is available in structure. This is the name to be used for the destination of the rename. |
TUNI_CONTAINS_CREATIONT | Creation time for file available. |
TUNI_CONTAINS_LASTACCESST | Last access time for file available. |
TUNI_CONTAINS_LASTWRITET | Last modification time for file available. |
tuni_pAltName
Supplies the alternate name in unicode that should be used for this file.
tuni_ftCreationTime
Supplies the creation time in the Win32 FileTime structure format specified below.
Win32 FileTime Structure: | |
Value | Meaning |
dwLowDateTime | Supplies the low double word of the time in Win32 format. |
dwHighDateTime | Supplies the low double word of the time in Win32 format. |
tuni_ftLastAccessTime | Supplies the last access time in the Win32 FileTime structure format described above. |
tuni_ftLastWriteTime | Supplies the last modification time in the Win32 FileTime structure format described above. |
ir_uFname
Pointer to the case-preserved filename component of the destination path in unicode.
ir_user
Supplies user id for this request.
ir_pid
Supplies process id for this request.
ir_error | Returns status of the operation ( 0 if no error, errorcode otherwise ). |
If an FSD does not support long filenames on a volume and it gets a LFN api call on that volume, it should fail the call. Note that FS_RenameFile can also rename entire directory trees. Obviously, the FSD cannot validate if all paths of the renamed directory can be accessed, some subdirectories may not be accessible any more if the path becomes longer than the maximum allowed path. The FSD should check for cyclic directory renames and fail them. A rename of a file to itself should not failed, the FSD should just return success and do nothing. Local FSDs also need to honour the tunnelling information if they do not implement tunnelling on their own. Tunnelling is not supported on network drives, so network FSDs do not need to support this. Tunnelling is described separately in another section of this document.