Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2011 23:57:22 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: how to tell that a file exists and is not 0-len?
Message-ID:  <4EFBACE2.3000206@infracaninophile.co.uk>
In-Reply-To: <20111228235010.GA28763@thought.org>
References:  <20111228235010.GA28763@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigCDC091BD3F5FEDB90ED17361
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 28/12/2011 23:50, Gary Kline wrote:

> access(filenamewithpath, F_OK) returned true  as Zero if i have
> access to it.  what do i use in C to tell me that a file is not =20
> empty?  fstat?  or is there something more common?

stat(2) which uses the file path -- unless you have an open file
descriptor on the file, in which case use fstat(2).

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW


--------------enigCDC091BD3F5FEDB90ED17361
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk77rOMACgkQ8Mjk52CukIzxeQCcC7cGu8ExmEKvFOC9NDP+I+Dm
EFUAn2/Dwgd8xm5xPxa/HYSHzeN7T+np
=MR71
-----END PGP SIGNATURE-----

--------------enigCDC091BD3F5FEDB90ED17361--



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