Skip to content

Filenames with colons cannot be added to archive #70

@enricoschumann

Description

@enricoschumann

When I try to create an archive from files that have colons in their names, I get an error:

filedir <- tempdir()
## browseURL(filedir)

filename <- "aaa:bbb.txt"
writeLines("test", file.path(filedir, filename))

zip::zip(file.path(filedir, "colon.zip"),
         files = filename,
         root = filedir)
Error in zip_internal(zipfile, files, recurse, compression_level, append = FALSE,  : 
  zip error: `Cannot add file `aaa:bbb.txt` to archive `/tmp/RtmpxBaRKe/colon.zip`` in file `zip.c:348`

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions