Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

StorageFile.RenameAsync | renameAsync methods

Applies to Windows and Windows Phone

Renames the current file.

Overload list

MethodDescription
RenameAsync(String) Renames the current file.
RenameAsync(String, NameCollisionOption) Renames the current file. This method also specifies what to do if an existing item in the current file's location has the same name.

Remarks

If the name you specify is invalid, this method throws an exception. To handle all the ways the specified name could be invalid, you must catch all four of these exceptions:

E_INVALIDARG
E_FAIL
ERROR_FILENAME_EXCED_RANGE
ERROR_INVALID_NAME

 

If the file is deleted before the rename finishes, this method throws the ERROR_FILE_NOT_FOUND exception. You must also catch and handle this exception when you use this method.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Storage
Windows::Storage [C++]

Metadata

Windows.winmd

See also

StorageFile

 

 

Show:
© 2014 Microsoft