1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: cp.coretag,v 1.5 2007-03-30 23:40:54 pajamian Exp $
10 UserTag cp Order from to
12 UserTag cp Version $Revision: 1.5 $
13 UserTag cp Routine <<EOR
16 my ($from, $to, $opt) = @_;
17 #Debug("cp from=$from to=$to umask=$opt->{umask}");
20 $opt->{umask} = oct($opt->{umask});
21 $save_mask = umask($opt->{umask});
23 my $status = File::Copy::copy($from, $to);
25 if ($opt->{preserve_times}) {
28 ($atime, $mtime) = (stat $from)[8,9];
31 $status = utime($atime, $mtime, $from);
38 umask($save_mask) if defined $save_mask;
39 return '' if $opt->{hide};