Results 1 to 2 of 2
- 10-17-2012, 04:19 PM #1
Senior Member
- Join Date
- May 2010
- Posts
- 113
- Rep Power
- 0
How to get the filename from a directory path. Their is only one file in the director
Hi
I see code for listing all the files present in a directory.
I my directory path, Their is only one file, how to get the file name from the path and read the file, (Please tell me how to get the name of the only file in the directory?)
by checking if it is readable ( I know this part).
Thank You.
- 10-17-2012, 05:09 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: How to get the filename from a directory path. Their is only one file in the dire
Here's the File API.
This has all the methods for getting a List<File> for a directory, and the name of a file.Please do not ask for code as refusal often offends.
Similar Threads
-
how can i get directory path without select any file ?
By amr magdy in forum New To JavaReplies: 1Last Post: 12-29-2011, 11:52 AM -
How to delete files, based on a matching pattern in the filename in a directory.
By renu in forum New To JavaReplies: 6Last Post: 10-11-2011, 09:48 PM -
I need to set new directory path in tomcat
By Mayank Joshi in forum Java ServletReplies: 2Last Post: 05-05-2010, 12:16 PM -
get the size and filename of the jar file run from and SHA
By aztectrev in forum Advanced JavaReplies: 4Last Post: 04-03-2010, 06:20 PM -
Reading a directory and getting the filename
By mrjunsy in forum Advanced JavaReplies: 1Last Post: 05-10-2008, 02:36 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks