Skip to content

Instantly share code, notes, and snippets.

@jonalter
Created June 27, 2011 20:35
Show Gist options
  • Select an option

  • Save jonalter/1049763 to your computer and use it in GitHub Desktop.

Select an option

Save jonalter/1049763 to your computer and use it in GitHub Desktop.
List files in the resourcesDirectory
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
layout: 'vertical'
});
var testButton = Ti.UI.createButton({
title: "list files",
top: 20,
height: 50,
width: 250,
});
testButton.addEventListener('click', function(e){
var dir = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory);
var files = dir.getDirectoryListing();
Ti.API.info('ALL FILES '+files);
var qty = files.length;
i=0;
while (i < qty)
{
Ti.API.info('ROW '+files[i]);
i++;
}
});
win.add(testButton);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment