Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> OT RE: Year of Unix file
Maybe
it's just me, and it could be because I am not following this thread at all,
but.....
<FONT face=Arial color=#0000ff
size=2>
Is
this the list's longest running thread to date? lol.....
<FONT face=Arial color=#0000ff
size=2>
no
offense meant!
<FONT face=Arial color=#0000ff
size=2>
-
Ross
<FONT face=Tahoma
size=2>-----Original Message-----From: Brian MacLean
[mailto:bmaclean_at_vcommerce.com]Sent: Monday, July 30, 2001 5:21
PMTo: Multiple recipients of list ORACLE-LSubject: RE:
Year of Unix file
save the following as fstat.c, compile it with "cc -o fstat
fstat.c", then run it as "fstat myfile"
#include <stdio.h> #include
<sys/types.h> #include <sys/stat.h>
#include <errno.h> #include
<time.h>
int rtn; struct stat buf_st;
struct tm *tm_st;
main( argc, argv, envp) int
argc; char **argv, **envp; <FONT
size=2>{ time_t now; <FONT
size=2> if( argc != 2 ) { fprintf( stderr, "Error: number of args\n" ); exit( 1 ); <FONT size=2> } rtn = stat( argv[1],
fprintf( stderr, "FILE=%s\n", argv[1] ); fprintf( stderr, "SIZE=%d\n", buf_st.st_size ); fprintf( stderr, "MODE=%d\n", buf_st.st_mode );tm_st = localtime( &buf_st.st_mtime ); fprintf( stderr, "MTIME=%10.10d -> %2.2d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d ->%s", <FONT
size=2> buf_st.st_mtime, <FONT size=2> tm_st->tm_mon + 1, tm_st->tm_mday, tm_st->tm_year - 100, tm_st->tm_hour, tm_st->tm_min, tm_st->tm_sec, <FONT size=2> ctime( &buf_st.st_mtime ) );tm_st = localtime( &buf_st.st_atime ); fprintf( stderr, "ATIME=%10.10d -> %2.2d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d ->%s", <FONT
size=2> buf_st.st_atime, <FONT size=2> tm_st->tm_mon + 1, tm_st->tm_mday, tm_st->tm_year - 100, tm_st->tm_hour, tm_st->tm_min, tm_st->tm_sec, <FONT size=2> ctime( &buf_st.st_atime ) );tm_st = localtime( &buf_st.st_ctime ); fprintf( stderr, "CTIME=%10.10d -> %2.2d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d ->%s", <FONT
size=2> buf_st.st_ctime, <FONT size=2> tm_st->tm_mon + 1, tm_st->tm_mday, tm_st->tm_year - 100, tm_st->tm_hour, tm_st->tm_min, tm_st->tm_sec, <FONT size=2> ctime( &buf_st.st_ctime ) ); <FONT size=2> time( &now ); tm_st =
size=2> tm_st->tm_mon + 1, tm_st->tm_mday, tm_st->tm_year - 100, tm_st->tm_hour, tm_st->tm_min, tm_st->tm_sec, <FONT size=2> ctime( &now ) );
size=2> now, tm_st->tm_mon + 1, tm_st->tm_mday, tm_st->tm_year, <FONT size=2> tm_st->tm_hour, tm_st->tm_min, tm_st->tm_sec, ctime( &now )
![]() |
![]() |