From owner-freebsd-questions Thu Aug 1 8:58:59 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E617D37B407 for ; Thu, 1 Aug 2002 08:58:53 -0700 (PDT) Received: from mail.isg.siue.edu (mail.isg.siue.edu [146.163.5.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7525043E65 for ; Thu, 1 Aug 2002 08:58:49 -0700 (PDT) (envelope-from vcardon@siue.edu) Received: from WEBSHIELD1.isg.siue.edu (webshield1.isg.siue.edu [146.163.5.149]) by mail.isg.siue.edu (8.9.1/8.9.1) with SMTP id KAA16132 for ; Thu, 1 Aug 2002 10:57:45 -0500 (CDT) Received: FROM _HOSTNAME_ BY WEBSHIELD1.isg.siue.edu ; Thu Aug 01 10:57:44 2002 -0500 Received: by _HOSTNAME_ (sSMTP sendmail emulation); Thu, 1 Aug 2002 11:00:21 -0500 Date: Thu, 1 Aug 2002 11:00:21 -0500 From: vcardon To: MET Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Slightly off topic - C++ Message-ID: <20020801160021.GD1132@spastic.siue.edu> Mail-Followup-To: MET , freebsd-questions@FreeBSD.ORG References: <001001c23970$dae6e2c0$6901a8c0@SURVIVAL> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xB0nW4MQa6jZONgY" Content-Disposition: inline In-Reply-To: <001001c23970$dae6e2c0$6901a8c0@SURVIVAL> User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --xB0nW4MQa6jZONgY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 01, 2002 at 11:33:50AM -0400, MET wrote: > Anybody know where I might find a good tutorial or something on > directory/file browsing in C++. I'm trying to write a program that > backs up MySQL databases, quite a few, and keeps track of them by not > letting the backups exceed a certain number. Naturally this would be > done by deleting files that are X amount of days/weeks old. However, to > do this I need to be able to scan all the files in a specific directory > and then obtain information on when they were created/modified. > =20 > I know there are Perl programs that do this, but I'd rather do it myself > ~ its a learning experience. You can use the MySQL++ C++ API to create the backups. Then you will need to use some UNIX system calls in order to check the modification times on directories and files. As far as tutorials are concerned, there is a tutorial for MYSQL++ in the documentation section of the MySQL site. I am not aware of any good tutorials for UNIX system calls, but I am sure a google search would turn something up. If you have access to it, I highly recommend _Advanced_Programming_in_the_UNIX_Environment_ by W. Richard Stevens. I hope that helps. Victor --xB0nW4MQa6jZONgY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9SVsVZU/bSegbOhwRAtE1AJ0VDj6nLmPc2oOwN3GytMSwiT2ELwCgpZMa nGVEp3gTpI4ws4boHW6iNx8= =gHYR -----END PGP SIGNATURE----- --xB0nW4MQa6jZONgY-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message