Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Get Directory/File List within Application's

Is it possible to get a listing of \DroidApp\Resources\ dir from within the application?

I want to store each file within that dir into an Array and run a loop to either list it out or associate it to a button.

The difficult part for me is to get all the files into an Array.

var files = new Array();

foreach (list.of.files.in.Resources){
   files[i] = each file;
— asked November 30th 2010 by Crzy Sheeit
  • directory
  • file
  • list
1 Comment
  • Is this it?

    var dfo = Titanium.Filesystem.getFile(yourDir);

    var fid = dfo.getDirectoryListing();

    Is 'fid' an array that holds the files?

    — commented November 30th 2010 by Crzy Sheeit

1 Answer

  • You also should use the file system property to get the resources directory

    — answered November 30th 2010 by Aaron Saunders
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.