Closed enricoschumann closed 1 year ago
I don't think it is a zip format limitation, but it could be a minizip limitation.
Same problem on :
Zip tool included in OSX replace :
by /
alone.
Indeed a miniz limitation:
static mz_bool mz_zip_writer_validate_archive_name(const char *pArchive_name)
{
/* Basic ZIP archive filename validity checks: Valid filenames cannot start with a forward slash, cannot contain a drive letter, and cannot use DOS-style backward slashes. */
if (*pArchive_name == '/')
return MZ_FALSE;
while (*pArchive_name)
{
if ((*pArchive_name == '\\') || (*pArchive_name == ':'))
return MZ_FALSE;
pArchive_name++;
}
return MZ_TRUE;
}
We could work around this, macOS builtin zip happily creates a zip file with :
in the file name. OTOH I suspect that this is going to cause issues on Windows.
When I try to create an archive from files that have colons in their names, I get an error:
This happens on R 4.0.3 on Ubuntu 20.10. I am aware that colons are not allowed on Windows, but is this a general/documented limitation of
zip
?