Changeset 27423


Ignore:
Timestamp:
2013-05-24T09:39:00+12:00 (8 years ago)
Author:
jmt12
Message:

Adding canRead() and isAbsolute() functions

File:
1 edited

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
Note: See TracChangeset for help on using the changeset viewer.