Menu

Conditional Logic

LampDev
2004-12-10
2013-04-25
  • LampDev

    LampDev - 2004-12-10

    I posted this in the BNR forum but it had no business there.
    I'm not sure if you had this in mind or not, but your proggy would be sweet as hell if it had some sort of conditional logic in queue.

    For instance, say I just downloaded a whole bunch of stuff. Then my usual routine would be to check each download that has a parity file, wait until it is finished, then IF nothing needs to be repaired, THEN extract it to a download directory on another hard disk and delete all RARs and PARs, ELSE then I repair the files, then extract and delete. I continue on with that fashion until everything is extracted and deleted from the directory.

    I was thinking the logic would go something similar to this:
    [CODE]
    JobCompleted = FALSE
    // loop until files are finished
    While ( JobCompleted = FALSE )
    {  Run the parity file
      If ( Need X more block to Recover )
      { EXIT LOOP
         // Job still not completed because of lack of parity files.
         // Mark job as a FAILURE and skip exraction
      }
      ElseIf (Repair Needed)
      {  Repair files
      }
      ElseIf (All file are OK)
      {  Extract To ... [Pre-defined Directory]
         Delete All used PAR and RAR Files
         JobCompleted = TRUE
      }
    }
    [/CODE]
    Then at the end of the batch, or during the operation, you could show a logfile of all the SUCCESSES, FAILURES, and FIX's during the operation.

    This could save me TONS of time because I suspect my system has bad RAM. Sometimes after a par2 repair, the damn thing fails. So I would have to rename the directory all the files were in and recheck. After rechecking, the files simply need to be re-joined properly. Then again, it could possibly fail. Then I would need to rename the directory AGAIN and recheck with par2. After doing that, I have to attempt to rejoin/repair it again and I continue in this fashion until it marks it as a success.
    The reason I have to change the directory name is because quickpar doesn't re-check ALL of the blocks after a repair. Perhaps more accurately, it doesn't do it correctly and I can only trust a SUCCESS after a clean check.

     
    • S. Jamison Wilde

      I responded over at BNR2 but I will do better about checking the forum here.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.