Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: capitalizing file names



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