File separators of Path name of ZipEntry?

后端 未结 2 1261
执笔经年
执笔经年 2020-12-06 04:19

ZIP entries store the full path name of the entry because (I\'m sure of the next part) the ZIP archive is not organized as directories. The metadata contains the info about

2条回答
  •  悲&欢浪女
    2020-12-06 04:53

    The file separator is dependent on the application that creates the zip file. Some applications use the system file separator, whereas some use the "civilized" forward slash "/". So, if you are creating the zip file and then consuming it, then you can simply use a forward slash as file separator. If the zip file is created on somewhere else, then you should find out which separator was used. I don't know a simple way, but you can use a brute method and check out both separator types as you progress.

    Some applications, especially custom zip creation codes, can mix the separators on different zip entries, so don't forget to check out each entry.

提交回复
热议问题