From: Takashi Iwai Subject: Re: PATCH for alsa-info.sh - using mktemp for instead of hardcoded temp dir. Date: Wed, 27 Feb 2008 18:04:06 +0100 Message-ID: References: <200802280036.52665.wishie@wishie.net> <200802280242.20175.wishie@wishie.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 14CFB246A9 for ; Wed, 27 Feb 2008 18:04:07 +0100 (CET) In-Reply-To: <200802280242.20175.wishie@wishie.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Travis Place Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 28 Feb 2008 02:42:20 +1000, Travis Place wrote: > > On Thu, 28 Feb 2008 2:39:16 am you wrote: > > At Thu, 28 Feb 2008 00:36:52 +1000, > > > > Travis Place wrote: > > > Email subject should explain well enough. > > > > I see some problems with this change: > > - it doesn't work if /tmp/alsainfo doesn't exist > > - temp directory isn't removed if --no-upload is given > > > > I think you should avoid --tempdir=xxx with mktemp. > > > > The output file name is another question. > > IMO, it'd be better to pass the output file name via a command line > > option, and put it on the home directory (e.g. ~/alsa-info.out) as > > default rather than /tmp. > > well, /tmp/alsainfo/ will exist, as we create it in the script.. its > $ALSAINFODIR .. the temp dir is then created inside that. It's created too late. And, if we create /tmp/alsainfo, there is little merit of mktemp as /tmp/alsainfo could be a symlink. Simply TEMPDIR should be what mktemp creates, and clean it up after quitting. > As for not being cleaned up, if --no-upload is specified, ill check that now.. > > Also, is outputting the resulting file to ~/ wise ? It's at least safer than the fixed filename on /tmp. I don't insist on this option, though. Anyway, --output-file=xxx would be a nice addition. > should this occur even if the result is uploaded, or only on > --no-upload ? I don't think it's needed when uploaded (except for any debugging reason). Just my $0.02. thanks, Takashi