locked
as share target:IStorageItem Path is empty on Win 8; but has Path Value on Win 8.1 RRS feed

  • Question

  • Hello,

    I reference the share target code on both Win 8 & Win 8.1, For 'sharedStorageItems' items, when I get one element of type IStorageItem, the Name value is always right on Win 8 & win 8.1, but the Path value is not consistent.

    On Win 8, the Path value is empty, On Win 8.1, the Path value is meaningful.

    Is it a bug on Win 8 ?

    From Strongpan@live.com

    Saturday, July 27, 2013 7:13 AM

Answers

  • Operate on the StorageFile. Don't try to convert it to a path.

    You cannot rely on there being a path, and even if there is one you may not have access to use it. This is true on Windows 8 as well as on Windows 8.1.

    --Rob

    • Proposed as answer by Anne Jing Monday, July 29, 2013 5:35 AM
    • Marked as answer by ideastore Wednesday, July 31, 2013 12:46 AM
    Sunday, July 28, 2013 5:03 AM
    Moderator

All replies

  • No. StorageItems aren't guaranteed to be backed by a path.

    --Rob

    Saturday, July 27, 2013 2:50 PM
    Moderator
  • OKay, so any suggestion for me to retrieve the storage item path so that I can operate on the file ?

    Thanks so much.

    Sunday, July 28, 2013 1:49 AM
  • Operate on the StorageFile. Don't try to convert it to a path.

    You cannot rely on there being a path, and even if there is one you may not have access to use it. This is true on Windows 8 as well as on Windows 8.1.

    --Rob

    • Proposed as answer by Anne Jing Monday, July 29, 2013 5:35 AM
    • Marked as answer by ideastore Wednesday, July 31, 2013 12:46 AM
    Sunday, July 28, 2013 5:03 AM
    Moderator
  • thanks, Rob.
    Wednesday, July 31, 2013 12:46 AM