Changeset 27423

Show
Ignore:
Timestamp:
24.05.2013 09:39:00 (6 years ago)
Author:
jmt12
Message:

Adding canRead() and isAbsolute() functions

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/perllib/FileUtils/HDFSShell.pm

    r27386 r27423  
    111111############################### Public Functions ############################### 
    112112################################################################################ 
     113 
     114 
     115## @function canRead() 
     116# 
     117sub canRead 
     118{ 
     119  my $path = shift(@_); 
     120  # On my Hadoop setups it appears everyone can read everything... pretty sure 
     121  # this won't always be the case but I'm not sure if there is some easy way to 
     122  # determine readability (you'd need to parse the permissions, user, and group 
     123  # and then somehow compare to the current user). So instead I'll just return 
     124  # if the file exists 
     125  return &fileTest($path, '-f'); 
     126} 
     127## canRead() 
    113128 
    114129 
     
    218233} 
    219234## filenameConcatenate() 
     235 
     236 
     237## @function isFilenameAbsolute() 
     238# 
     239sub isFilenameAbsolute 
     240{ 
     241  # File paths against HDFS must be. 
     242  return 1; 
     243} 
     244# isFilenameAbsolute() 
    220245 
    221246