How can i get an users input in the format of /home/filedirectory
and then list all the files in the path /home/filedirectory??
Dinesh_9
0
Light Poster
Recommended Answers
Jump to Postfor the first part: have him type it, have him select a folder on his hd.
for the second, use the methods that are in the File class
Jump to Postmost likely the problem. without the correct path, it'll look for the file on the wrong place.
you can check this somewhat like this:File f = new File(files);
and then printing the path of f.
All 12 Replies
stultuske
1,116
Posting Maven
Featured Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Dinesh_9
0
Light Poster
stultuske
1,116
Posting Maven
Featured Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Dinesh_9
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Dinesh_9
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
stultuske
1,116
Posting Maven
Featured Poster
Dinesh_9
0
Light Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.