|
Basically he is telling you that when you run your program on a Windows machine, Windows is taking care of the fact that your path convention is CIFS specific (it's call an UNC). When you run this program on a System i, FileReader doesn't know how to open a file using the path you've specified because the i5/OS uses IFS paths not CIFS. You can get JCIFS and use that to open files on Windows shares from the System i and it uses URL naming conventions like Thorbjørn mentioned. You can get JCIFS at http://jcifs.samba.org/ and they have any number of examples that could be useful to you. Coy Krill Systems Analyst Whidbey Island Bank -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Smith, Mike Sent: Wednesday, March 21, 2007 06:21 To: Java Programming on and around the iSeries / AS400 Subject: RE: RUNJVA problems Thanks for the reply. The RGC_AD is a windows server. I'm not sure I totally understand what you mean here. --FileReader basically uses the underlying operating system to resolve the --name. The path you have used in your code is Windows specific (and --refers to a file on the RGC-AD machine), and is not valid on a --non-Windows host. --If the file is located on the AS/400 you should identify its local name --and use that instead. --If the file is located on another host, you need to use code that knows --that. E.g. JTopen knows how to talk to a remote AS/400. --In case this is a frequent scenario you might want to start use an URL --to refer to your files. This allows you to use many different protocols --to access them, and to provide your own in case you have a very frequent --and cumbersome task. Can you provide me with an example? Java class resides in IFS, being called from CL program, accessing a file on a windows server. Thanks. Michael Smith iSeries.mySeries. -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Thorbjørn Ravn Andersen Sent: Tuesday, March 20, 2007 10:00 AM To: Java Programming on and around the iSeries / AS400 Subject: Re: RUNJVA problems Smith, Mike skrev den 20-03-2007 12:46:
My problem now is that I'm referencing a file in my class, but I'm getting a 'No such path or directory' error. I know that the path is valid, because I can run successfully within WDSC.
On your Windows machine?
BufferedReader in = new BufferedReader(new FileReader("\\\\rgc-ad\\Public\\customer Service\\Lockbox\\Lockbox Payment Datafiles\\020707P.txt"));
FileReader basically uses the underlying operating system to resolve the name. The path you have used in your code is Windows specific (and refers to a file on the RGC-AD machine), and is not valid on a non-Windows host. If the file is located on the AS/400 you should identify its local name and use that instead. If the file is located on another host, you need to use code that knows that. E.g. JTopen knows how to talk to a remote AS/400. In case this is a frequent scenario you might want to start use an URL to refer to your files. This allows you to use many different protocols to access them, and to provide your own in case you have a very frequent and cumbersome task.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.