none
Using CloudFileDirectory to get total bytes in use?

    Question

  • Hello,

    I'm trying to use Microsoft.WindowsAzure.Storage framework in C# to find out how much disk space is being used by a folder on my Azure File Share. I can get the ClouldFile.Properties.Length of a file, but I can't seem to get the equivilent for a Directory.

    Is this a situation where I would need to write a recursive function to enumerate the entire contents of the directory? Or is there a quick way to query that information?

    thanks!

    Michael


    Michael

    Thursday, September 1, 2016 4:44 PM

Answers

  • Hi -

    There isn't any way to do this with the storage client library for .NET.

    Azure Files is a standard SMB file share, so it also supports the file system I/O APIs - in your case, part of the .NET framework. However, there doesn't appear to be a way to use the .NET framework APIs to do this either. 

    Check out this Stack Overflow question on the same issue:

    http://stackoverflow.com/questions/468119/whats-the-best-way-to-calculate-the-size-of-a-directory-in-net

    Thursday, September 1, 2016 6:43 PM