on 07-23-2006 4:48 PM
Hi All,
I am trying to access a text file from the local directory.
The code is,
FileReader fr = new FileReader("c:/temp/1.txt");
This code raises an exception:
c:\temp\1.txt (The system cannot find the file specified)
What is wrong in this code?
How do i read a file then?
Thanks
Thruna
Hi Turuna,
Does "c:\temp\1.txt" really exist on the SERVER where you are running your code?
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tiruna,
at first: This example is just for a demo case. Don't use it for real use cases. You won't know the path on the server, where you want to get your file from. Use the URL Generator Service: http://help.sap.com/saphelp_nw2004s/helpdata/en/9e/a073001903c9419592b14c2aa63669/frameset.htm
Back to your issue: If your server is a windows machine, build the string in this way: "C:
temp
1.txt"
Kind Regards
Stefanie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
While running your project on server it always check to server path. It doesn't check on client machine. So please verify this file is avilable on server.
Kind Regards,
S.Saravanan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.