File.list

R

Roedy Green

Has anyone looked inside File.list to see how the native method is
implemented on Windows?

I notice it that my own File.list code to scan directories seems to
run considerably slower than C utilities, e.g. looking for junk files
to delete. The hard disk also seem to "buzz" as if doing many small
seeks when in runs my code.

I have my hard disk well defragged with the most of the directories
contiguous and lumped together to make such scanning efficient.

I also notice that Take Command, which maintains a simple flat file
mirror listing all the directories on disk can find scan for a string
and jump to a directory ever so much faster than java can scan.

I am wondering if this is just the nature of Java-OS mismatched
impedance, or there is something that could be done to speed up
File.list. It is doing anything stupid?
 
J

John B. Matthews

Would be interesting if you measured if FileSystemView.getFiles()
performs different from file.listFiles().

Interesting. "Java Licensees may want to provide a different
implementation of FileSystemView to better handle a given operating
system."

<http://java.sun.com/javase/6/docs/api/javax/swing/filechooser/FileSystemView.html>

This thread examines some memory related issues regarding
FileSystemView.getFileSystemView():

<http://groups.google.com/group/comp.lang.java.programmer/browse_frm/thread/16d16e4f9b7d9509>

This related study was recently updated:

<http://sites.google.com/site/trashgod/garbageheap>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top