Patent ID: 8504541

Claim:
A file management method for data files, the file management method comprising: creating a tree of directories with M levels, the M levels numbered from 1 to M, with M being an integer greater than 1, wherein the tree includes N directories of level 1 , with N being an integer greater than 1, wherein for each level X from 1 to M−1, each one of the directories of level X includes N directories of level X+1, and wherein files are only stored in directories of level M; recording a first data file of the data files, including: applying a hash function to an identifier of the first data file, determining a path in the tree of a destination directory of level M according to the result of the hash function, recording the first data file in the destination directory; and reading a second data file of the data files, including: applying the hash function to an identifier of the second data file, determining a path in the tree of a target directory according to the result of the hash function; attempting simultaneous opening and locking of the second data file from the target directory using a single operation of a file system, wherein in response to the simultaneous opening and locking of the second data file being successful, the file system prevents further opening of the second data file until the second data file is unlocked; and in response to the simultaneous opening and locking of the second data file being successful, (i) reading a state parameter of the second data file; (ii) in response to the state parameter indicating that the second data file is unavailable, closing and unlocking the second data file; (iii) in response to the state parameter indicating that the second data file is available: modifying the state parameter to indicate unavailability of the second data file, calculating a first acquisition identifier, and writing the first acquisition identifier to the second data file; and closing and unlocking the second data file.