How to test whether a drive uses Block level or File level storage?
Go to solution
Solved by Poet129,
This works:
from timeit import timeit from os import remove def allwrite(): TestFile = open("TestFile", "wb") Data = b'\x00' * 512000 * 20 TestFile.write(Data) TestFile.close() def allread(): TestFile = open("TestFile", "rb") Data = TestFile.read() TestFile.close() def partread(): TestFile = open("TestFile", "rb") Data = TestFile.read(512000) TestFile.close() if __name__ == '__main__': a = timeit(allwrite, number=1) b = timeit(allread, number=1) c = timeit(partread, number=1) if (c < b): print("Your File System's Stucture is Block Based.") else: print("Your File System's Stucture is File Based.") remove("TestFile")
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now