VMware Cloud Community
JakeP
Enthusiast
Enthusiast

Get a list of files in a folder?

Hello all,

I have another newbie question. How can I read a list of all of the files from a folder/share and put the file names in an array?

Thanks,

Jake

0 Kudos
2 Replies
cdecanini_
VMware Employee
VMware Employee

Here is an example. file.list returns the array of the filenames.

Please note that you will have to set the permissions (How can I write to files?)

var file = new File(System.getTempDirectory());

System.log(file.list());

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
warring
Enthusiast
Enthusiast

Try RVtools very handy for getting lots of info.

VCP510-DCV
0 Kudos