locked
StorageFolder from absolute path RRS feed

  • Question

  • Our app typically passes around full paths to places, so when something like a drag/drop occurs, we fetch the full path, then pass that to a routine that enumerates everything below it.  I am not seeing a way to create a StorageFolder from an absolute path.  I have seen a C# example that looked something like:  ... = StorageFolder.GetFolderFromPathAsync(@"C:\Test");  Is there a C++ equivalent?

    Regards, Guy

    Thursday, April 26, 2012 10:43 PM

Answers

All replies

  • Friday, April 27, 2012 1:16 AM
    Moderator
  • Hi Steve,

    I am trying GetFolderFromPathAsync() to build a StorageFolder object on a Metro App using JavaScript from a path like C:\Test\Stuff but getting always error 3 Access Denied. do you know if it is available on JS too? do you have an exmaple? thanks in advace

    Alex


    Friday, May 4, 2012 4:42 PM
  • I could be wrong, but Metro's sandboxing only lets you access files that have been chosen, by the user, through file pickers. If you're just using test data, try moving it into the folder your app is running from, since Metro app's seem to always have access to the executable folder. I'm also wondering... if you're using drag and drop, then isn't it a Desktop app? Using Metro may be unnecessarily restraining you.

    Software Engineer, Brainium Studios LLC


    Friday, May 4, 2012 11:17 PM
  • Thanks for your reply Brent, maybe I have to explain the use case. I already have open and load operations using storage file pickers and also save to files. What I am trying to achieve is load something like a settings/project file previously saved by my application when you double click it, as you can have it located in any place, I am just trying to get the StorageFolder wherever the files are in the disk. That is my issue actually.

    Any help appreciated, I'm sure I am doing something wrong, but can't figure out what that is...

    Saturday, May 5, 2012 2:29 PM
  • I think what you're describing is called a "most recently used" (MRU) list. I found this thread. It suggests using  StorageApplicationPermissions. MostRecentlyUsedList and  StorageApplicationPermissions.FutureAccessList, and there's also mention of Windows.Storage.AccessCache. Those might be what you're looking for.

    Software Engineer, Brainium Studios LLC

    Monday, May 7, 2012 5:10 PM