Skip to content

Instantly share code, notes, and snippets.

@hell0again
Created March 7, 2014 00:34
Show Gist options
  • Save hell0again/9402726 to your computer and use it in GitHub Desktop.
Save hell0again/9402726 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# mtimeを揃える
# same_mtime dir1 dir2
use strict;
use File::Find;
my @d = @ARGV;
my $our_mtime = 0;
sub _mtime {
my @st = stat $_;
$our_mtime = $st[9] if ($our_mtime < $st[9]);
}
sub _utime {
utime $our_mtime, $our_mtime, $_;
}
map {
find(\&_mtime, $_);
} @d;
map {
find(\&_utime, $_);
} @d;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment