giving absolute path name in fopen - VxWorks

This is a discussion on giving absolute path name in fopen - VxWorks ; Hi everyone,
Specification : I am running Tornado 2.2 on VxWorks 5.5.1.
Problem : I am trying to open a file by giving the absolute
path name,but fopen is not able to open the file.Below is a snippet of
my ...

giving absolute path name in fopen

Hi everyone,

Specification : I am running Tornado 2.2 on VxWorks 5.5.1.
Problem : I am trying to open a file by giving the absolute
path name,but fopen is not able to open the file.Below is a snippet of
my code
fopen("C:\\abc.txt","r");

Temporary Solution : Presently i am copying the file in the same
directory where my vxworks.exe simulator is running and opening the
file as below
fopen("abx.txt","r");

I am trying to figure out why the absolute path is not working.

Thanks
Shireesh

Re: giving absolute path name in fopen

Hi

I assume you are running in the simulator environment.

I think what you are looking for is the ability to set the root of the
Target Server File System. This can be done when you create the target
connection. In the dialog "Target Server Options, click "Advanced
target server options > Edit", and set the root dir to c:/.

You will still write only fopen("abc.txt", "r") - now, however, this
will be on the root of C:

Hope this is what you're looking for...

Troels Jensen

shireeshbhat@gmail.com skrev:
> Hi everyone,
>
> Specification : I am running Tornado 2.2 on VxWorks 5.5.1.
> Problem : I am trying to open a file by giving the absolute
> path name,but fopen is not able to open the file.Below is a snippet of
> my code
> fopen("C:\\abc.txt","r");
>
> Temporary Solution : Presently i am copying the file in the same
> directory where my vxworks.exe simulator is running and opening the
> file as below
> fopen("abx.txt","r");
>
> I am trying to figure out why the absolute path is not working.
>
> Thanks
> Shireesh

Re: giving absolute path name in fopen

Hi Troels,

Thanks for replying.
Yeah,i am running on the simulator environment.
I checked the target server options.The root dir is already set to c:\
(and not c:/ as i am running the simulator on windows)
So suppose i running a executable in some internal directory.And if the
executable wants to open a file which is residing in some other
directory.How does one go about it.

Thanks
Shireesh

Troels Jensen wrote:
> Hi
>
> I assume you are running in the simulator environment.
>
> I think what you are looking for is the ability to set the root of the
> Target Server File System. This can be done when you create the target
> connection. In the dialog "Target Server Options, click "Advanced
> target server options > Edit", and set the root dir to c:/.
>
> You will still write only fopen("abc.txt", "r") - now, however, this
> will be on the root of C:
>
> Hope this is what you're looking for...
>
> Troels Jensen
>
> shireeshbhat@gmail.com skrev:
>
> > Hi everyone,
> >
> > Specification : I am running Tornado 2.2 on VxWorks 5.5.1.
> > Problem : I am trying to open a file by giving the absolute
> > path name,but fopen is not able to open the file.Below is a snippet of
> > my code
> > fopen("C:\\abc.txt","r");
> >
> > Temporary Solution : Presently i am copying the file in the same
> > directory where my vxworks.exe simulator is running and opening the
> > file as below
> > fopen("abx.txt","r");
> >
> > I am trying to figure out why the absolute path is not working.
> >
> > Thanks
> > Shireesh

Re: giving absolute path name in fopen

Hi again

Did you try "/abc.txt" instead of just "abc.txt"?

/Troels

phoenix wrote:
> Hi Troels,
>
> Thanks for replying.
> Yeah,i am running on the simulator environment.
> I checked the target server options.The root dir is already set to c:\
> (and not c:/ as i am running the simulator on windows)
> So suppose i running a executable in some internal directory.And if the
> executable wants to open a file which is residing in some other
> directory.How does one go about it.
>
> Thanks
> Shireesh
>
> Troels Jensen wrote:
> > Hi
> >
> > I assume you are running in the simulator environment.
> >
> > I think what you are looking for is the ability to set the root of the
> > Target Server File System. This can be done when you create the target
> > connection. In the dialog "Target Server Options, click "Advanced
> > target server options > Edit", and set the root dir to c:/.
> >
> > You will still write only fopen("abc.txt", "r") - now, however, this
> > will be on the root of C:
> >
> > Hope this is what you're looking for...
> >
> > Troels Jensen
> >
> > shireeshbhat@gmail.com skrev:
> >
> > > Hi everyone,
> > >
> > > Specification : I am running Tornado 2.2 on VxWorks 5.5.1.
> > > Problem : I am trying to open a file by giving the absolute
> > > path name,but fopen is not able to open the file.Below is a snippet of
> > > my code
> > > fopen("C:\\abc.txt","r");
> > >
> > > Temporary Solution : Presently i am copying the file in the same
> > > directory where my vxworks.exe simulator is running and opening the
> > > file as below
> > > fopen("abx.txt","r");
> > >
> > > I am trying to figure out why the absolute path is not working.
> > >
> > > Thanks
> > > Shireesh