directory to archive with name includes slash '/'
Hi Developer,
I am wondering is there a way to directory an archive to a name with '/',
var NameWithSlash = 'Folder 1/2'; archive.directory( '/path/to/be/archived', '/des/path/'+NameWithSlash, { date: new Date() });
When I did that now it will automatically recognize '/' in NameWithSlash as a path separator instead of string.
What is the right way to doing so?
Thanks,
I'm not sure I've ever tried using / as part of a filename as I believe there are OS that don't support that like Windows.
Have you confirmed this works in zip or tar outside of archiver? I know theres a few spots in archiver that uses slash detect directory so that would be a hard limit to such with archiver without refactoring of codebase.
Same issue on linux trying to archive a directory whose files names contains backslashes (which are legit on *nix)
Same problem here with macOS
we can replace "/" or "" with ":" Node archiver replace ":" as "/" in string name
Regex for replaceing slashes: fileName.replace(/\|//gm, ':')
Hope this will help
Node archiver replace ":" as "/" in string name
any idea on how to tweak that? having issues with a folder containing : that's being replaced and apparently some Windows users can't extract the archive