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.

FileInformation class

Applies to Windows only

Provides synchronous access to the properties exposed off StorageFile and lets an app perform asynchronous file operations such as copy, delete, move, and rename.

Syntax


/* For information about creating or accessing this object, see Remarks. */

Attributes

[Version(0x06020000)]

Members

The FileInformation class has these types of members:

Events

The FileInformation class has these events.

EventDescription
PropertiesUpdated Occurs when one or more of the StorageFile's properties is updated.
ThumbnailUpdated Fires when the StorageFile's thumbnail is updated or a better quality thumbnail is available.

 

Methods

The FileInformation class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
CopyAndReplaceAsync Replaces the specified StorageFile with a copy of the current file.
CopyAsync(IStorageFolder) Creates a copy of the StorageFile and stores it in the specified StorageFolder.
CopyAsync(IStorageFolder, String) Creates a copy of the StorageFile, gives it the specified file name, and stores it in the specified StorageFolder.
CopyAsync(IStorageFolder, String, NameCollisionOption) Creates a copy of the StorageFile, gives it the specified file name, and stores it in the specified StorageFolder. The method also specifies what to do if a file with the same name already exists in the specified folder.
DeleteAsync() Deletes a file.
DeleteAsync(StorageDeleteOption) Deletes a file, optionally moving the deleted file to the recycle bin.
GetBasicPropertiesAsync Retrieves the basic properties of the StorageFile.
GetParentAsync Gets the parent folder of the current file.
GetThumbnailAsync(ThumbnailMode) Retrieves the thumbnail that is associated with the StorageFile.
GetThumbnailAsync(ThumbnailMode, UInt32) Retrieves the thumbnail that is associated with the StorageFile, scaling it to the specified size.
GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) Retrieves the thumbnail that is associated with the StorageFile, based on the specified options.
IsEqual Indicates whether the current file is the same as the specified storage item.
IsOfType Determines whether the loaded StorageFile is the specified type.
MoveAndReplaceAsync Moves the current StorageFile from its location and uses it to replace the specified StorageFile.
MoveAsync(IStorageFolder) Moves the StorageFile to the specified StorageFolder.
MoveAsync(IStorageFolder, String) Moves the StorageFile to the specified folder, and gives the file the specified file name.
MoveAsync(IStorageFolder, String, NameCollisionOption) Moves the StorageFile to the specified folder and gives it the specified file name. The 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 StorageFile.
OpenReadAsync Opens a read-only, random-access stream over the StorageFile.
OpenSequentialReadAsync Opens a read-only, sequential-access stream over the StorageFile.
OpenTransactedWriteAsync Opens a random-access stream to the file that can be used for transacted-write operations.
RenameAsync(String) Renames the StorageFile.
RenameAsync(String, NameCollisionOption) Renames the StorageFile, and specifies what to do if a file with the same name already exists in the current folder.

 

Properties

The FileInformation class has these properties.

PropertyAccess typeDescription

Attributes

Read-onlyGets the attributes of a file.

BasicProperties

Read-onlyGets an object that contains the basic properties information of the file.

ContentType

Read-onlyGets a string that describes the contents of the file.

DateCreated

Read-onlyGets the date that the file was created.

DisplayName

Read-onlyGets the user-friendly name of the StorageFile.

DisplayType

Read-onlyGets the display type of the StorageFile.

DocumentProperties

Read-onlyGets an object that provides access to the document properties of the StorageFile, such as the title, author name, and so on.

FileType

Read-onlyGets the file type.

FolderRelativeId

Read-onlyGets the identifier that uniquely identifies the StorageFile relative to other items in the same folder.

ImageProperties

Read-onlyGets the image properties of the StorageFile, such as the title, rating, date that the image was taken, and so on.

IsAvailable

Read-onlyIndicates if the current file has been downloaded or can be downloaded.

MusicProperties

Read-onlyGets the music properties associated with the StorageFile, such as the album name, artist name, bit rate, and so on.

Name

Read-onlyGets the name of the StorageFile.

Path

Read-onlyGets the path of the StorageFile.

Properties

Read-onlyGets an object for retrieving the properties of the StorageFile.

Provider

Read-onlyGets the StorageProvider object that contains info about the service that stores the current file.

Thumbnail

Read-onlyGets the thumbnail associated with the StorageFile.

VideoProperties

Read-onlyGets an object that provides access to the video properties of the StorageFile, such as the duration, rating, date released, and so on.

 

Remarks

You can retrieve a list of FileInformation objects by calling one of the fileInformationFactory.getFilesAsync methods.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

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

Metadata

Windows.winmd

See also

FileInformationFactory.GetFilesAsync
IStorageItemInformation
IStorageFile
IStorageItem
IRandomAccessStreamReference
IInputStreamReference
IStorageItemProperties
IStorageItem2
IStorageItemPropertiesWithProvider
IStorageFilePropertiesWithAvailability

 

 

Show:
© 2014 Microsoft. All rights reserved.