Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get file size in WinRT?

In WinRT there is no FileInfo class, only a StorageFile class.

How can I get the size of a file using the StorageFile class?

like image 476
Yang Avatar asked Jan 05 '13 03:01

Yang


People also ask

What do you mean by get file size ()?

The GetFileSize function retrieves the uncompressed size of a file.

How do I get the size of a CPP file?

To get a file's size in C++ first open the file and seek it to the end. tell() will tell us the current position of the stream, which will be the number of bytes in the file.

How do I find the size of a file in Windows?

Open My Computer or Windows Explorer. Make Windows display file properties by clicking View at the top of the window, and then selecting Details. Once this action is completed, Explorer displays all your files, their sizes, type, and last modified date.


1 Answers

So here you go:


storageFile.getBasicPropertiesAsync().then(
    function (basicProperties) {
        var size  = basicProperties.size;
    }
);
like image 130
Vahid Farahmand Avatar answered Oct 25 '22 04:10

Vahid Farahmand