Hot fix

fix the problem which results in the failure of Test case 2. Add
reference map to the FileManager class to count the opening times of
each file. Now test units 1 to 7 work fine