Actually the problem was that my code requested DELETE access to the directory, which was needed to make setting DOS names work correctly. But the DOS name shouldn't be set on the root directory anyway, since it could be extracted to an arbitrary name in which case the existing DOS name (there shouldn't be one anyway) would not be meaningful. So I'll just skip requesting DELETE access for the extraction root.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually the problem was that my code requested DELETE access to the directory, which was needed to make setting DOS names work correctly. But the DOS name shouldn't be set on the root directory anyway, since it could be extracted to an arbitrary name in which case the existing DOS name (there shouldn't be one anyway) would not be meaningful. So I'll just skip requesting DELETE access for the extraction root.