Writing a method to check whether any files have been added or removed from the directory

The compFile method compares the old and new list of files to see whether there is a mismatch between the two. It iterates through the old and new list of files of the directory under observation to check whether any new files have been added or removed. The addFile variable stores the added files and the remFile variable stores the removed files. The files that were present both during the initial hashing and during the verification are stored in the array,extFile . You can find the code for the compFile method in the App.js file at https://github.com/PacktPublishing/Blockchain-Development-for-Finance-Projects/blob/master/Chapter%207/Docs%20App/src/App.js.

At the end of the execution, the method sets the arrays extFile, remFile, and addFile to the app state. It then calls the fileCheck method to check which of the individual files have been tampered.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.13.173