views:

33

answers:

1

What is the fastest way for a Adobe AIR program program to index all images on a users' computer?

Using Open Source ActionScript-3, MXML Libs and classes.

  • Fastest - Same pc configuration, different time (seconds)

  • To index - get a list of absolute links (like c://bla-bla/file ) and save them into file (index.txt)

  • All images (like JPEGs, PNGs)

+1  A: 

Not sure if it's the fastest, but what comes to mind is using AIR's Native Process API to make the search through command prompt.

A simple example would be

find *.jpg *.jpeg *.png

You can then use standardOutput.readUTFBytes. This might be faster then writing the search result to a text file then loading. After that you can parse the file. You can always have a look at the find options for better results.

Anyway, just a thought...speaking of which, to quote @quoo:

why would you want to do this?

George Profenza
Will find *.jpg *.jpeg *.png work on mac lin and win?=) I want to create Itunes analog for Images.
Blender
Actually, is not a bad idea. In Windows you could use dir /S: http://www.computerhope.com/dirhlp.htm. The other option seems to be recursively read folders, which is probably quite slow.
Zárate
@Ole Jak the find command is on linux/osx as well, but you might be better of using locate instead of find. @Zárate yup! the dir and tree options can be quite
George Profenza
Ok by now... But pure AS3\MXML way would be cooler (in a way - Native installer will not ever soon be a way for mobile devices, I (my self) Do not know how to install AIR app from Browser (Using Badger) and there will be no default way to run app from browser=( ) but AIR AS3\MXML way probably will be mych slower... Will it be much slower?
Blender
@Ole Jak There is a badge sample that comes with the AIR SDK. Also there is this article on devnet: http://www.adobe.com/devnet/air/articles/air_badge_install_print.html and gskinner's AIR Badger: http://www.gskinner.com/blog/archives/2008/09/beware_the_air.html. HTH,George
George Profenza