locked
get files or folders from non "knownfolders" RRS feed

  • Question

  • can i get as in sample "program file access" subfiles and subfolders of custom path instead of known folders?

    for example, i need get all files in "c"\windows\". Can i read them or system folders are loked? or only libraries are available withou filepicker?

    also, can i get info about drives, like available space or type (hdd, dvd or usb-hdd etc)?

    • Edited by Romka2411 Monday, January 13, 2014 5:35 PM
    Monday, January 13, 2014 4:53 PM

Answers

All replies

  • Only by user selection. Apps don't have access to these areas.
    Monday, January 13, 2014 6:04 PM
    Moderator
  • but skydrive can do that, its quite bad, because skydrive not so useful as explorer, and explorer isnt comfortable for touchscreen. Anyway,

    1) can i get to these areas by c++ or javascript?

    1a) for javascript, can i use something like that:

    fso = new ActiveXObject("Scripting.FileSystemObject");

    var e = new Enumerator(fso.Drives);

    for (; !e.atEnd(); e.moveNext()) {
            drv = e.item();

    l=drv.DriveLetter.toUpperCase();

    }

    i know it breaks app, but can i somehow avoid breaking and get to this object?

    2) What will happen if i try write file bigger than available space on disk?


    • Edited by Romka2411 Tuesday, January 14, 2014 12:44 PM
    Tuesday, January 14, 2014 9:54 AM
  • no its not working. the security model will prevent this.

    And skydrive is since windows 8.1 part of Windows so has more permissions.


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Tuesday, January 14, 2014 12:36 PM
  • No, language doesn't matter. Windows Store apps need user permission to access the disk outside of their install and app data directories.

    If you run out of disk space the file access will fail.

    --Rob

    Tuesday, January 14, 2014 3:34 PM
    Moderator
  • so all i can do - its catch exception? can i in x86 and x64 platform link to desktop library to simply get (read) diskinfo?
    Wednesday, January 15, 2014 2:22 AM
  • You need to catch the exception in any case. Even if you check the free disk space before writing a file it may not be available when you do copy the file.

    GetDiskFreeSpaceExW is supported for Windows Store apps so long as you call it on a folder you have access to, such as the Package.Current.InstalledLocation.

    Again though, you can't depend on the answer as it may change before you use it.

    --Rob

    Wednesday, January 15, 2014 2:35 AM
    Moderator