From owner-freebsd-questions@FreeBSD.ORG Wed Dec 19 00:32:52 2012 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 491C4DD7 for ; Wed, 19 Dec 2012 00:32:52 +0000 (UTC) (envelope-from kline@thought.org) Received: from smtpauth20.prod.mesa1.secureserver.net (smtpauth20.prod.mesa1.secureserver.net [64.202.165.36]) by mx1.freebsd.org (Postfix) with SMTP id 0A7298FC14 for ; Wed, 19 Dec 2012 00:32:51 +0000 (UTC) Received: (qmail 14629 invoked from network); 19 Dec 2012 00:26:11 -0000 Received: from unknown (209.180.213.209) by smtpauth20.prod.mesa1.secureserver.net (64.202.165.36) with ESMTP; 19 Dec 2012 00:26:11 -0000 Date: Tue, 18 Dec 2012 16:26:10 -0800 From: Gary Kline To: FreeBSD Mailing List Subject: which C function is best to check for directory EXISTANCE? Message-ID: <20121219002610.GA12470@ethic.thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2012 00:32:52 -0000 which C function is best to check for the existence of a *directory*? say that I am want to make postitve that "/tmp/foo/" exists. ALso: which will make sure that the directory AND ffile "tmp/foo/filename12345" exists and that I have read access to it? in other words, can playing around with access() and stat() be best? is there any new dirstat("PATh") that would work? just want to see which way is best? dank mucho, y'all! gary -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix Twenty-six years of service to the Unix community.