How to return file date only?
I am trying to return the creation date of a file in MMDDhhmmYY format. I'm sure there is a command, I just can not find it. Under cygwin the command is `date +%m%d%H%M%y -r $FILE`, however FreeBSD does not have this function with 'date' Thanks for any help! _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: How to return file date only?
On 2002-11-20 23:22, How Can ThisBe [EMAIL PROTECTED] wrote: I am trying to return the creation date of a file in MMDDhhmmYY format. I'm sure there is a command, I just can not find it. Under cygwin the command is `date +%m%d%H%M%y -r $FILE`, however FreeBSD does not have this function with 'date' FreeBSD has stat(1). keramida@gothmog[01:50]/home/keramida stat -f '%c' . 1037835701 To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: How to return file date only?
'stat' does not seem to be installed (at least by default) on a FreeBSD 4.7-STABLE system $ stat -f '%c' . stat: not found Any other ideas? From: Giorgos Keramidas [EMAIL PROTECTED] Subject: Re: How to return file date only? On 2002-11-20 23:22, How Can ThisBe [EMAIL PROTECTED] wrote: I am trying to return the creation date of a file in MMDDhhmmYY format. I'm sure there is a command, I just can not find it. Under cygwin the command is `date +%m%d%H%M%y -r $FILE`, however FreeBSD does not have this function with 'date' FreeBSD has stat(1). keramida@gothmog[01:50]/home/keramida stat -f '%c' . 1037835701 _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: How to return file date only?
On 2002-11-20 23:57, How Can ThisBe [EMAIL PROTECTED] wrote: From: Giorgos Keramidas [EMAIL PROTECTED] Subject: Re: How to return file date only? FreeBSD has stat(1). keramida@gothmog[01:50]/home/keramida stat -f '%c' . 1037835701 'stat' does not seem to be installed (at least by default) on a FreeBSD 4.7-STABLE system $ stat -f '%c' . stat: not found Any other ideas? Perl :) % cat ctime.pl use POSIX qw(gmtime strftime); if (defined($ARGV[0])) { ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat($ARGV[0]); print strftime('%T', gmtime($ctime)) . \n; } % perl ctime.pl . 00:07:00 To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: How to return file date only?
On Wednesday 20 November 2002 18:57, How Can ThisBe wrote: 'stat' does not seem to be installed (at least by default) on a FreeBSD 4.7-STABLE system $ stat -f '%c' . stat: not found Any other ideas? Always ports if you want to use it. snoopy(/home/ph1)% whereis stat stat: /usr/ports/sysutils/stat [snip] To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message