Changeset 4440

Show
Ignore:
Timestamp:
03/27/12 15:34:34 (6 years ago)
Author:
pcanadilla
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tolp/OfficialTolArchiveNetwork/EtlUtils/funFileUtils.tol

    r4306 r4440  
    1515    "unzip -x " + fileToDescompress + " -d " + whereToDecompress + " " + opts ; 
    1616   
    17   Text TraceETL(sysCmd, "Des") ; 
     17  Text TraceETL("The file " + fileToDescompress + " is going to be " +  
     18    "descompressed in folder " + whereToDecompress, "Des") ; 
     19 
     20  Text TraceETL(sysCmd, "Cue") ; 
    1821  Real sysExe = System(sysCmd) ; 
     22  Text TraceCmdRes(res) ; 
    1923  sysExe 
    2024} ; 
     
    3236  Text resAux = LTrim(RTrim(ReadFile(fileAux))) ; 
    3337  Real res = TextToReal(Tokenizer(resAux, " ")[1]) ; 
     38  Real FileDelete(fileAux) ; 
    3439  res 
    3540} ; 
     
    4146 
    4247////////////////////////////////////////////////////////////////////////////// 
    43 Real DelRecordOriToDest( 
     48Real DelRecords( 
    4449  Text fileOri, Text fileDes, Real posOri, Real posDest) 
    4550////////////////////////////////////////////////////////////////////////////// 
    4651{ 
     52 
     53  // param integrity check 
     54  Real If (Or(posOri<=0, posDest<=0), 
     55  { 
     56    Text TraceETL("<E>The parameters has to be greater that zero", "Res") ; 
     57    Real Stop 
     58  }, 
     59  { 
     60    Real TRUE 
     61  } 
     62  ) ; 
    4763 
    4864  Text txtPosOri = IntText(posOri) ; 
     
    5672  ) ; 
    5773 
    58   Real System(cmd) ; 
    59   Real TRUE 
     74  Text TraceETL("The records between " + txtPosOri + 
     75    "and " + txtPosDest + " are going to be deleted", "Des") ; 
     76  Text TraceETL(cmd, "Cue") ; 
     77 
     78  Real res = System(cmd) ; 
     79  Text TraceCmdRes(res) ; 
     80  Real res 
    6081} ; 
    6182////////////////////////////////////////////////////////////////////////////// 
    6283PutDescription("Remove in the file the records in consecutive range " + 
    63 "PosOri - posDest. If posOri is greater that posDes, no sed command is done", 
    64 DelRecordOriToDest) ; 
     84"PosOri - posDest. If posOri is greater that posDes, no command is run", 
     85DelRecords) ; 
    6586////////////////////////////////////////////////////////////////////////////// 
    66