Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Nov 2002 02:07:59 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        How Can ThisBe <howcanthisbe300@hotmail.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: How to return file date only?
Message-ID:  <20021121000759.GD4791@gothmog.gr>
In-Reply-To: <F165VMFgnjXXBARdkfw00002bf1@hotmail.com>
References:  <F165VMFgnjXXBARdkfw00002bf1@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2002-11-20 23:57, How Can ThisBe <howcanthisbe300@hotmail.com> wrote:
> >From: Giorgos Keramidas <keramida@ceid.upatras.gr>
> >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 majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021121000759.GD4791>