fixed #4: modify to calc fileindex correctly
Merge pull request #5 from 3100/4-one-file

fixed #4: modify to calc fileindex correctly