]> git.p6c8.net - devedit.git/blobdiff - modules/File/Access.pm
Allow to change the group of a file using the Group ID
[devedit.git] / modules / File / Access.pm
index 31ad87dde4561393962b46c1008001c73f800639..bc1e37d57437f7c248c0ac7ce556d624cdd020b8 100644 (file)
@@ -7,7 +7,7 @@ package File::Access;
 # with only one command
 #
 # Author:        Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2004-07-28
+# Last modified: 2004-08-01
 #
 
 use strict;
@@ -40,7 +40,7 @@ use base qw(Exporter);
 sub chgrp($@)
 {
  my ($group,@files) = @_;
- my $gid = getgrnam($group);
+ my $gid = ($group !~ /^\d+$/) ? getgrnam($group): $group;
 
  return unless($gid);
  return chown(-1,$gid,@files);

patrick-canterino.de