getting file attributes
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 > getting file attributes




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

    getting file attributes  
satish challa


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


 
08-29-04 07:49 AM

Hi,
i want to the know the following,could any of u tell me.
How to get the attributes of a file(Linux) through a C program
like the time,the file last modified,last accessed etc.
How to check the System time in C,are there any functions defined
in time.h or any system calls.
How to access a remote file through a C program.
Thank you





[ Post a follow-up to this message ]



    Re: getting file attributes  
SM Ryan


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


 
08-29-04 07:49 AM

satish_challa@sify.com (satish challa) wrote:
# Hi,
#    i want to the know the following,could any of u tell me.
#     How to get the attributes of a file(Linux) through a C program
# like the time,the file last modified,last accessed etc.

Check the stat man page
man 2 stat

That will get modified and access times, mode, size, etc,

#      How to check the System time in C,are there any functions defined
# in time.h or any system calls.

You can get the time in seconds with time(0)

#      How to access a remote file through a C program.

Unless you're thinking of something like a locally mounted NFS volume,
this can be very complicated. You can check up on various URL libraries.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
Where do you get those wonderful toys?





[ Post a follow-up to this message ]



    Re: getting file attributes  
Ganesh


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


 
08-29-04 12:48 PM

satish_challa@sify.com (satish challa) wrote in message news:<ef44bd70.0408282159.34984c35@p
osting.google.com>...
> Hi,
>    i want to the know the following,could any of u tell me.
>     How to get the attributes of a file(Linux) through a C program
> like the time,the file last modified,last accessed etc.

man 2 stat

>      How to check the System time in C,are there any functions defined
> in time.h or any system calls.

man 2 time
man 3 ctime

>      How to access a remote file through a C program.
>                     Thank you





[ Post a follow-up to this message ]



    Re: getting file attributes  
Pascal Bourguignon


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


 
08-29-04 10:52 PM

satish_challa@sify.com (satish challa) writes:
>      How to access a remote file through a C program.

You should read various RFC (http://www.rfc-editor.org/)

Search for NFS, FTP, HTTP, WebDAV, and perhaps others that I don't
remember right now.  There, you'll have all the specifications needed
to implement the protocols needed to access a remote file through a C
program.


--
__Pascal Bourguignon__                     http://www.informatimago.com/

Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.





[ Post a follow-up to this message ]



    Re: getting file attributes  
Barry Kimelman


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


 
09-02-04 11:50 PM

[This followup was posted to comp.unix.programmer]

While wandering through cyberspace on 28 Aug 2004 22:59:45 -0700 satish
challa said :
> Hi,
>    i want to the know the following,could any of u tell me.
>     How to get the attributes of a file(Linux) through a C program
> like the time,the file last modified,last accessed etc.

the "stat" or "lstat" system calls can get you the informatiion you need



>      How to check the System time in C,are there any functions defined
> in time.h or any system calls.

the "time" function can give you the system time (in seconds elapsed
since the great beginning)


>      How to access a remote file through a C program.
>                     Thank you
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:45 AM.      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