locked
How to detect if there is not free space on disk under WinRT RRS feed

  • Question

  • Hi everybody

    I use StorageFile.CopyAsync() method to copy file to the folder chosen by user. In case if there is no free disk space this method throws "Error HRESULT E_FAIL has been returned from a call to a COM component.". ()

    Is there any way to check available disk space  Windows Store Applications?

    Anatol

    Tuesday, September 24, 2013 1:35 PM

Answers

  • Hi AnatloSe,

    Unfortunately Windows Store App does not provide such information. Perhaps you could tell your user the possibility of why the error message displays and let them validate the system.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 30, 2013 1:51 AM
    Moderator
  • Hi Anatol,

    Since Windows Store App are running in a sandbox model, you cannot fetch any information from the system, for this reason, I don't think there would be any API or other ways to check if there is available disk space. But you could always use try-catch to handle the exception.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, September 25, 2013 1:00 AM
    Moderator

All replies

  • Hi Anatol,

    Since Windows Store App are running in a sandbox model, you cannot fetch any information from the system, for this reason, I don't think there would be any API or other ways to check if there is available disk space. But you could always use try-catch to handle the exception.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, September 25, 2013 1:00 AM
    Moderator
  • Hi Anatol,

    Since Windows Store App are running in a sandbox model, you cannot fetch any information from the system, for this reason, I don't think there would be any API or other ways to check if there is available disk space. But you could always use try-catch to handle the exception.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thank James for reply

    I'd already wrapped CopyAsync with try-catch, but in my case I want to say user what problem he/she has, E_FAIL doesn't provide me enough info( 

    Anatol

    Wednesday, September 25, 2013 12:30 PM
  • Hi AnatloSe,

    Unfortunately Windows Store App does not provide such information. Perhaps you could tell your user the possibility of why the error message displays and let them validate the system.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 30, 2013 1:51 AM
    Moderator