file system question
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > file system question




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    file system question  
Janice


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-25-04 10:52 PM

I use ls -l to list a file which is a link. I got the following.
/lib/terminfo.lnk -> ../share/terminfo
If I use stat("/lib/terminfo.lnk",buf), I get errno=2, which means No such
file or directory.
What is the reason for this contradictory result?
Thanx







[ Post a follow-up to this message ]



    Re: file system question  
Dragan Cvetkovic


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-25-04 10:52 PM

"Janice" <no@mail.com> writes:

> I use ls -l to list a file which is a link. I got the following.
> /lib/terminfo.lnk -> ../share/terminfo
> If I use stat("/lib/terminfo.lnk",buf), I get errno=2, which means No such
> file or directory.
> What is the reason for this contradictory result?

There is no contradiction here. Your soft links could point anywhere.

E.g.

% ln -s /doesntexist/doesntexist a
% ls -lgo a
lrwxrwxrwx   1      24 Oct 25 12:35 a -> /doesntexist/doesntexist


stat() call follows the link (lstat() doesn't). Does /share/terminfo exist
on your system?

Bye, Dragan

--
Dragan Cvetkovic,

To be or not to be is true. G. Boole      No it isn't.  L. E. J. Brouwer

!!! Sender/From address is bogus. Use reply-to one !!!





[ Post a follow-up to this message ]



    Re: file system question  
Janice


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-25-04 10:52 PM

Thank you for your reply.
The /share/terminfo doesnt exist.
Thank you for telling me the different between lstat and stat.

"Dragan Cvetkovic" <me@privacy.net> ???????:lmu0sidacj.fsf@privacy.net...
> "Janice" <no@mail.com> writes:
> 
such[vbcol=seagreen] 
>
> There is no contradiction here. Your soft links could point anywhere.
>
> E.g.
>
> % ln -s /doesntexist/doesntexist a
> % ls -lgo a
> lrwxrwxrwx   1      24 Oct 25 12:35 a -> /doesntexist/doesntexist
>
>
> stat() call follows the link (lstat() doesn't). Does /share/terminfo exist
> on your system?
>
> Bye, Dragan
>
> --
> Dragan Cvetkovic,
>
> To be or not to be is true. G. Boole      No it isn't.  L. E. J. Brouwer
>
> !!! Sender/From address is bogus. Use reply-to one !!!







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:34 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register