A
az
I have two questions regarding file I/O:
(1) If I want to open data.txt in C:\test directory, how to pass
directory name to FileInputStream?
I know how to open data.txt in current directory:
FileInputStream in = new FileInputStream("data.txt")
How to pass C:\test to FileInputStream?
Is the following code right?
FileInputStream in = new FileInputStream("C:\test\data.txt")
(2) How to get a list of file names under C:\test directorr? I want to
get a vector of file names under C:\test directory. How to do this?
Thanks for your help!
(1) If I want to open data.txt in C:\test directory, how to pass
directory name to FileInputStream?
I know how to open data.txt in current directory:
FileInputStream in = new FileInputStream("data.txt")
How to pass C:\test to FileInputStream?
Is the following code right?
FileInputStream in = new FileInputStream("C:\test\data.txt")
(2) How to get a list of file names under C:\test directorr? I want to
get a vector of file names under C:\test directory. How to do this?
Thanks for your help!