Answered by:
StorageFolder from absolute path

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
-
GetFolderFromPathAsync is available in both C# and C++ - http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefolder.getfolderfrompathasync.aspx#Y135
- Proposed as answer by Steve HorneMicrosoft employee, Moderator Friday, April 27, 2012 9:17 PM
- Marked as answer by gnichola Friday, April 27, 2012 9:20 PM
Friday, April 27, 2012 1:16 AMModerator
All replies
-
GetFolderFromPathAsync is available in both C# and C++ - http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefolder.getfolderfrompathasync.aspx#Y135
- Proposed as answer by Steve HorneMicrosoft employee, Moderator Friday, April 27, 2012 9:17 PM
- Marked as answer by gnichola Friday, April 27, 2012 9:20 PM
Friday, April 27, 2012 1:16 AMModerator -
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
- Edited by Alex7904574 Friday, May 4, 2012 8:56 PM
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
- Edited by brentAtBrainium Friday, May 4, 2012 11:19 PM
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