Results 1 to 3 of 3

Thread: Difference between stat, fstat, lstat

  1. #1
    Contributing Member
    Join Date
    May 2006
    Answers
    71

    Difference between stat, fstat, lstat

    Can someone tell me the difference between stat, fstat, lstat. Also tell me whether it is possible to use stat() only in Linux or Unix environment or is it possible to use it even in Windows environment.


  2. #2
    Contributing Member
    Join Date
    May 2006
    Answers
    82

    Re: Difference between stat, fstat, lstat

    As far as the working of stat with windows I am sure that it would work with windows. As far as the functionality of stat() is considered it takes the syntax as
    int stat(const char *path, struct stat *buf);
    The function is used to return information about a file. The file referred is pointed in path and the value is filled in buf mentioned above.


  3. #3
    Contributing Member
    Join Date
    May 2006
    Answers
    72

    Re: Difference between stat, fstat, lstat

    Some of the diffrence between stat(),fstat() and lstat() is
    For stat() and lstat() serach permission is needed in the path mentioned in the file to perform their operation but it is not so in case of fstat()
    In lstat() it is possible to put symbolic link and if the mentioned object is symbolic link the path is considered fully and not the file alone as in case of stat()
    fstat() performs the same functionality but by making use of the concept of file descriptors. If there is any other difference put your discussion to envisage knowledge


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact