AirTip: List all of your drives in AIR application

Thursday, August 28th, 2008
AirTip: List all of your drives in AIR application

This is quick Air Tip: If you need get list of all of your drives in code, just use

var list:Array = File.getRootDirectories();

It list all of y our hard drives with CD ROM drives. But if CD is inserted in CD ROM drive, it will be listed as well. I don’t find way how to find out if drive is CD ROM drive, you can just search for files on that inserted CD.

If there is a way how to find out, if drive is CD ROM drive, let us know

tagged under: .

ABOUT THIS AUTHOR

Get a Trackback link

1 Comments


  1. sHTiF
    Visit Site
    September 13th, 2008

    I run into this problem of detecting a CD drive just a little ago and there really is no “normal” way to detect it but i found a little trick that will do the job. Its simple i try to create a file on each of the root directories and then delete em, if this creation fails i am assuming its a CD drive (or a drive that is disabled for writing in other way) it proved really usefull ;)

Live Preview

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

CommentLuv Enabled

Images is enhanced with WordPress Lightbox JS by Zeo