[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: loginfo %s question
From: |
gabriel rosenkoetter |
Subject: |
Re: loginfo %s question |
Date: |
Tue, 20 Nov 2001 05:02:08 -0500 |
User-agent: |
Mutt/1.2.5i |
On Tue, Nov 20, 2001 at 01:36:59AM -0800, Emile Snyder wrote:
> However, %s doesn't seem to be just the file name, as the default loginfo
> comment indicates, but rather "directory file", ie. with a space. This is
> normally not a problem, but if you have spaces in your directory or file
> names, this makes it impossible to parse out the argument passed to
> log_accum.
Actually, that's the module name (which also happens to be a
directory path from $CVSROOT in this case), not the directory. (I'm
not clear on whether or not this can ever be something other than
a directory path... my hope is no, for unrelated reasons.)
Typically, something like (in Perl):
$_ = shift @ARGV;
my @files = split;
my $dir = $cvsroot . "/" . shift(@files);
would be enough to get the right stuff out on your end, but that
doesn't fix the problem you're seeing.
> And I modify filea and 'space file', then log_accum is called twice, and
> the filename arg it gets is, respectively:
> cvstest/dira filea
> and
> cvstest/space dir space file
>
> Am I missing something? Does anyone have any suggestions as to how to
> parse the output of %s from loginfo into a directory part and a filename
> part in a general fashion?
That's an ugly problem, and the only (clear and easy) answer I can
give is, "Don't do that."
Spaces in a Unix-like OS's file system are not handled particularly
well under many circumstances (say, um, any shell), making them a
generally bad idea.
--
~ g r @ eclipsed.net
pgpxDDyx8IaWt.pgp
Description: PGP signature