Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> 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;
{
time_t now; if( argc != 2 ) {
} rtn = stat( argv[1], &buf_st ); if( rtn != 0 ) {
} 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",tm_st->tm_mon + 1, tm_st->tm_mday, tm_st->tm_year - 100,
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",tm_st->tm_mon + 1, tm_st->tm_mday, tm_st->tm_year - 100,
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",tm_st->tm_mon + 1, tm_st->tm_mday, tm_st->tm_year - 100,
buf_st.st_ctime,
time( &now ); tm_st = localtime( &now ); fprintf( stderr, "NOW =%10.10d -> %2.2d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d ->%s",
now = 0; tm_st = localtime( &now ); fprintf( stderr, "EPOCH=%10.10d -> %2.2d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d ->%s",
-----Original Message-----
From: prasad maganti [mailto:prasadm_g_at_yahoo.com]
Sent: Friday, July 27, 2001 4:11 AM
To: Multiple recipients of list ORACLE-L
Subject: Year of Unix file
Hi dba's
when i list the unix file (solaris), with ls -lt command , i am able to see the time, month, date that is created.
is there any way to see the year that is created.
any commands....
prasad.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: prasad maganti INET: prasadm_g_at_yahoo.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Mon Jul 30 2001 - 15:25:12 CDT
![]() |
![]() |