IStorageFile interface

Applies to Windows and Windows Phone

Represents a file. Provides information about the file and its contents, and ways to manipulate them.

Note  If you simply want to work with files in your app, see the StorageFile class.

Syntax


public interface IStorageFile : IStorageItem, 
    IRandomAccessStreamReference, IInputStreamReference

Attributes

[Version(0x06020000)]

Members

The IStorageFile interface has these types of members:

Methods

The IStorageFile interface has these methods. It also inherits methods from the Object class.

MethodDescription
CopyAndReplaceAsync Replaces the specified file with a copy of the current file.
CopyAsync(IStorageFolder) Creates a copy of the file in the specified folder.
CopyAsync(IStorageFolder, String) Creates a copy of the file in the specified folder, using the desired name.
CopyAsync(IStorageFolder, String, NameCollisionOption) Creates a copy of the file in the specified folder, using the desired name. This method also specifies what to do if an existing file in the specified folder has the same name.
MoveAndReplaceAsync Moves the current file to the location of the specified file and replaces the specified file in that location.
MoveAsync(IStorageFolder) Moves the current file to the specified folder.
MoveAsync(IStorageFolder, String) Moves the current file to the specified folder and renames the file according to the desired name.
MoveAsync(IStorageFolder, String, NameCollisionOption) Moves the current file to the specified folder and renames the file according to the desired name. This method also specifies what to do if a file with the same name already exists in the specified folder.
OpenAsync Opens a random-access stream over the file.
OpenTransactedWriteAsync Opens a transacted, random-access stream for writing to the file.

 

Properties

The IStorageFile interface has these properties.

PropertyAccess typeDescription

ContentType

Read-onlyGets the MIME type of the contents of the file.

FileType

Read-onlyGets the type (file name extension) of the file.

 

Remarks

Note  If you simply want to work with files in your app, see the StorageFile class.

Interface inheritance

IStorageFile inherits IInputStreamReference, IRandomAccessStreamReference, and IStorageItem. Types that implement IStorageFile also implement the interface members of IInputStreamReference, IRandomAccessStreamReference, and IStorageItem.

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

Capabilities

picturesLibrary
videosLibrary
musicLibrary
documentsLibrary

See also

IInputStreamReference
IRandomAccessStreamReference
IStorageItem
StorageFile

 

 

Show:
© 2014 Microsoft