Loading...
Logo
Processing Forum

List Files

in Programming Questions  •  8 months ago  
Hi,
i wrote this simple code to try if the object "File" works, but it doesn't...

----------------------------------------------

import java.io.File;

File dir = new File("/Documenti/Processing/PhotoMultiPhoto/data");
String[] names = dir.list();
println(names.length);

----------------------------------------------

i really need to list files names from a folder, but if this don't work i don't know what to do, can someone help me?

Replies(4)

Re: List Files

8 months ago
You just gotta use a full path, then it should work.

Re: List Files

8 months ago
it doesn't :(

Re: List Files

8 months ago
That's because you're not using a full path as shown in your code above.

Re: List Files

8 months ago
ok, i restarted processing and now it works...