How to preserve filename and folder structure when using foremost recovery program?recovery data from RAID...

How to positively portray high and mighty characters?

Why does the numerical solution of an ODE move away from an unstable equilibrium?

What would Earth look like at night in medieval times?

How many satellites can stay in a Lagrange point?

Do equal angles necessarily mean a polygon is regular?

Fitting a mixture of two normal distributions for a data set?

If my Scout rogue has used his full movement on his turn, can he later use the reaction from the Skirmisher feature to move again?

What do you call the action of someone tackling a stronger person?

In the Marvel universe, can a human have a baby with any non-human?

"It will become the talk of Paris" - translation into French

First-year PhD giving a talk among well-established researchers in the field

Plata or Dinero

How can I convince my reader that I will not use a certain trope?

What determines the "strength of impact" of a falling object on the ground, momentum or energy?

Could Sauron have read Tom Bombadil's mind if Tom had held the Palantir?

Symbolic equivalent of chmod 400

When is it ok to add filler to a story?

How come I was asked by a CBP officer why I was in the US?

Does the posterior necessarily follow the same conditional dependence structure as the prior?

What is this particular type of chord progression, common in classical music, called?

Procedurally generate regions on island

Finding closed forms for various addition laws on elliptic curves, FullSimplify fails even with assumptions?

How risky is real estate?

Short story with brother-sister conjoined twins as protagonists?



How to preserve filename and folder structure when using foremost recovery program?


recovery data from RAID and disk failure (Linux)How do I rename lots of files on a directory without changing their extensions?basic help with safecopyHow to recover a shell script I deleted from a specific folder in Debian 7?How to keep exactly one file in a directory?Flattening complex folder structures with duplicate file namesRecover formatted ext4 partition with file structureRecover content of a directory when the block where directory file is located is corrupted?Script to compare and delete the files based on name and extension typeHow does 'Open with' a custom executable in Linux work?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am desperately needing to run the linux recovery software foremost and preserve filenames and folder structure. As you might know the program renames the recovered files with a numerical value and then lists them within a list inside a file called audit.txt that it generates.



I found this ruby script in another question within this great community where someone is trying to achieve the exact same thing with foremost that I am. Someone replied to the question with an answer containing a ruby script with simple instructions to run it within the folder that contains the audit.txt file - I have tried this and nothing happens. I have tried while running foremost as well as after completed, and nothing happens. I simply get no terminal output when attempting to run the ruby script you see below.



File.read("audit.txt").scan(/-{4,}n(File: .*?n.*?)(?=-{4,})/m).flatten.map{|z| 
f1=z.scan(/File: (.*?)n/).flatten[0];
f2=z.scan(/[0-9]+:t(.*?) t/m).flatten;
extension=File.extname(f1);

[
f1,
f2.find{|q| File.extname(q)==extension}
]
}.each{|k,v|
extension=File.extname(k);
dirname=extension.sub(".","")
File.rename("#{dirname}/#{v}","#{dirname}/#{k}")
}


Does anyone else know how to use the program foremost and preserve filename and folder structure? It is very critical that I am able to do this as foremost seems to be the one and only recovery program that is capable recovering my files, and I have tried roughly 30+ different recovery programs between both Linux and Windblows.










share|improve this question





























    0















    I am desperately needing to run the linux recovery software foremost and preserve filenames and folder structure. As you might know the program renames the recovered files with a numerical value and then lists them within a list inside a file called audit.txt that it generates.



    I found this ruby script in another question within this great community where someone is trying to achieve the exact same thing with foremost that I am. Someone replied to the question with an answer containing a ruby script with simple instructions to run it within the folder that contains the audit.txt file - I have tried this and nothing happens. I have tried while running foremost as well as after completed, and nothing happens. I simply get no terminal output when attempting to run the ruby script you see below.



    File.read("audit.txt").scan(/-{4,}n(File: .*?n.*?)(?=-{4,})/m).flatten.map{|z| 
    f1=z.scan(/File: (.*?)n/).flatten[0];
    f2=z.scan(/[0-9]+:t(.*?) t/m).flatten;
    extension=File.extname(f1);

    [
    f1,
    f2.find{|q| File.extname(q)==extension}
    ]
    }.each{|k,v|
    extension=File.extname(k);
    dirname=extension.sub(".","")
    File.rename("#{dirname}/#{v}","#{dirname}/#{k}")
    }


    Does anyone else know how to use the program foremost and preserve filename and folder structure? It is very critical that I am able to do this as foremost seems to be the one and only recovery program that is capable recovering my files, and I have tried roughly 30+ different recovery programs between both Linux and Windblows.










    share|improve this question

























      0












      0








      0








      I am desperately needing to run the linux recovery software foremost and preserve filenames and folder structure. As you might know the program renames the recovered files with a numerical value and then lists them within a list inside a file called audit.txt that it generates.



      I found this ruby script in another question within this great community where someone is trying to achieve the exact same thing with foremost that I am. Someone replied to the question with an answer containing a ruby script with simple instructions to run it within the folder that contains the audit.txt file - I have tried this and nothing happens. I have tried while running foremost as well as after completed, and nothing happens. I simply get no terminal output when attempting to run the ruby script you see below.



      File.read("audit.txt").scan(/-{4,}n(File: .*?n.*?)(?=-{4,})/m).flatten.map{|z| 
      f1=z.scan(/File: (.*?)n/).flatten[0];
      f2=z.scan(/[0-9]+:t(.*?) t/m).flatten;
      extension=File.extname(f1);

      [
      f1,
      f2.find{|q| File.extname(q)==extension}
      ]
      }.each{|k,v|
      extension=File.extname(k);
      dirname=extension.sub(".","")
      File.rename("#{dirname}/#{v}","#{dirname}/#{k}")
      }


      Does anyone else know how to use the program foremost and preserve filename and folder structure? It is very critical that I am able to do this as foremost seems to be the one and only recovery program that is capable recovering my files, and I have tried roughly 30+ different recovery programs between both Linux and Windblows.










      share|improve this question














      I am desperately needing to run the linux recovery software foremost and preserve filenames and folder structure. As you might know the program renames the recovered files with a numerical value and then lists them within a list inside a file called audit.txt that it generates.



      I found this ruby script in another question within this great community where someone is trying to achieve the exact same thing with foremost that I am. Someone replied to the question with an answer containing a ruby script with simple instructions to run it within the folder that contains the audit.txt file - I have tried this and nothing happens. I have tried while running foremost as well as after completed, and nothing happens. I simply get no terminal output when attempting to run the ruby script you see below.



      File.read("audit.txt").scan(/-{4,}n(File: .*?n.*?)(?=-{4,})/m).flatten.map{|z| 
      f1=z.scan(/File: (.*?)n/).flatten[0];
      f2=z.scan(/[0-9]+:t(.*?) t/m).flatten;
      extension=File.extname(f1);

      [
      f1,
      f2.find{|q| File.extname(q)==extension}
      ]
      }.each{|k,v|
      extension=File.extname(k);
      dirname=extension.sub(".","")
      File.rename("#{dirname}/#{v}","#{dirname}/#{k}")
      }


      Does anyone else know how to use the program foremost and preserve filename and folder structure? It is very critical that I am able to do this as foremost seems to be the one and only recovery program that is capable recovering my files, and I have tried roughly 30+ different recovery programs between both Linux and Windblows.







      linux scripting hard-disk data-recovery ruby






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      AnonymousAnonymous

      1147 bronze badges




      1147 bronze badges






















          0






          active

          oldest

          votes














          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f526457%2fhow-to-preserve-filename-and-folder-structure-when-using-foremost-recovery-progr%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f526457%2fhow-to-preserve-filename-and-folder-structure-when-using-foremost-recovery-progr%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m