Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: capitalizing file names
- X-seq: zsh-users 11484
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: capitalizing file names
- Date: Mon, 14 May 2007 18:56:57 +0100
- In-reply-to: <20070514185015.fd5c2ed1.pws@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Cambridge Silicon Radio
- References: <31691177567034@xxxxxxxxxxxxxxxxxx> <20070426071610.GA22513@xxxxxxxxxxxxxxxxxxxx> <20070514185015.fd5c2ed1.pws@xxxxxxx>
Peter Stephenson <pws@xxxxxxx> wrote:
> Presumably if the files really are equivalent, it's safe to attempt
> to mv in the hope that the file system knows what it's doing. We've
> already tested for $f = $g at this point.
...although this only applies if the action really is renaming.
Index: Functions/Misc/zmv
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Misc/zmv,v
retrieving revision 1.11
diff -u -r1.11 zmv
--- Functions/Misc/zmv 16 Jan 2004 15:29:27 -0000 1.11
+++ Functions/Misc/zmv 14 May 2007 17:55:17 -0000
@@ -262,13 +262,8 @@
continue
elif [[ -n $from[$g] && ! -d $g ]]; then
errs=($errs "$f and $from[$g] both map to $g")
- elif [[ -f $g && -z $opt_f ]]; then
- if [[ $f != $g && $f -ef $g ]]; then
- errs=($errs "file exists: $g
-(Probably the same file, owing to file system limitations.)")
- else
- errs=($errs "file exists: $g")
- fi
+ elif [[ -f $g && -z $opt_f && ! ($f -ef $g && $action = mv) ]]; then
+ errs=($errs "file exists: $g")
fi
from[$g]=$f
to[$f]=$g
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview
Messages sorted by:
Reverse Date,
Date,
Thread,
Author