fstream icon indicating copy to clipboard operation
fstream copied to clipboard

fstream ignores directories with long paths on windows

Open sdarnell opened this issue 11 years ago • 2 comments

When piping fstream.Reader() into tar.Pack() fstream ignores long pathnames on windows.

The calling code looks like this, but the problem seems to be on fstream side of the pipe, because I added a filter to log entries as they go by and nothing comes out.

  return fstream.Reader({ path: dirPath, type: 'Directory' }).pipe(
    tar.Pack({ noProprietary: true })).pipe(zlib.createGzip());

To be more precise, I think it is directories that get ignored.

Looking in lib/reader.js@104 and there is some code (legacy?) which tries to convert paths into the UNC form \\?\... when the paths hit 260 characters.

Firstly I think this code is probably redundant now as my understanding is that libuv handles the mapping to long names.

But what seems to be happening is that the code is called twice (not sure quite why), and performs the conversion twice - incorrectly. So I end up with invalid paths starting \\?\\\_\c:\ The underscore comes from what was previously a ?

My guess is that the whole win32 if at line 104 should be removed.

sdarnell avatar Nov 09 '14 01:11 sdarnell

https://status.npmjs.org/incidents/b4ktc38pypd1

aearly avatar Jun 06 '18 19:06 aearly

Thanks for the update!

Brantron avatar Jun 06 '18 20:06 Brantron

This incident is marked as resolved but the download count is still broken 😞

christian-bromann avatar Jul 16 '18 13:07 christian-bromann