Link to home
Start Free TrialLog in
Avatar of nuz1
nuz1

asked on

Specifying UNIX path in java properties file

Hi,

I wonder if an expert can assist.

I need to specify a unix path coreectly in my  properties file sitting on my C drive, as I need
to read a flat file from UNIX I know I can't just do;

 /home/johno/myfile.txt

and some escaping sequence is required.


Many thanks

Avatar of Mick Barry
Mick Barry
Flag of Australia image

> I know I can't just do;
> /home/johno/myfile.txt

That could be fine, how is the path used in your app?
Avatar of nuz1
nuz1

ASKER

hmm,

Sorry its a unix path ie \home\johno\myfile.txt ! it did not work

that did not work , I was told to use something like \\home\\johno\\myfile.txt

What do ya say?

Thanks.
> Sorry its a unix path ie \home\johno\myfile.txt ! it did not work

try it as you stated originally in your question

how is it being used?
Avatar of nuz1

ASKER

Sorry corrction

/home/johno/myfile.txt

is the unix path!

but my code don't like it

do I need  //home//johno//myfile.txt ?

Avatar of nuz1

ASKER

By the way it work fine if I use a foile on my C drive and specify

c//testarea//mytext.txt
how exactly does your code not like it?
Avatar of nuz1

ASKER

Just a minute getting error message..

Avatar of nuz1

ASKER

Caused by: java.io.FileNotFoundException: \test\dyn\data\gsbl\TESTT1main\app\data\instrument_20040917_v4.dat (The system cannot find the path specified)
Avatar of nuz1

ASKER

Hi Objects can idea?
Avatar of nuz1

ASKER

correction , sorry any idea?

SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nuz1

ASKER

Sorry for the confusion

As you know, UNIX paths are like :

/test/dyn/data/gsbl/TESTT1main/app/data/instrument_20040917_v4.dat

When I put that in I get:

Caused by: java.io.FileNotFoundException: \test\dyn\data\gsbl\TESTT1main\app\data\instrument_20040917_v4.dat (The system cannot find the path specified)

So please please clarify how this should be specified in properties (its an XML file .

)

OK if  I put this in properties I get
What are you running this on?  I don't see how the file separators are changing.
Avatar of nuz1

ASKER

I'm running the the java in IBM Websphere app server (out of container). As a java client (all on my PC).  Need to read the file from UNIX.

sounds like you are looking at the local system for a file that would be located on the server.  You will need to give the path to the server (the UNIX computer) for the program.  The best would be to give it in a URL format.   So, of course it is saying that the file is not found on the client (where you are currently looking), because you need to look in the server.  
Avatar of nuz1

ASKER

Hi could you please show how to specify it in URL format given the UNIX file is:

/test/dyn/data/gsbl/TESTT1main/app/data/instrument_20040917_v4.dat


thanks very much.
is the unix file system mounted?
How is the client expected to access the Unix server?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial