node-fswin icon indicating copy to clipboard operation
node-fswin copied to clipboard

getCompressedSize: get size of inaccessible files

Open aleksey-hoffman opened this issue 3 years ago • 2 comments

Hi @xxoo is it possible to make getCompressedSize function return the size even for inaccessible files?

I calculated the size of all files in C:\Windows and got 1.9 GB with getCompressedSizeSync while the File Explorer showed 27.2 GB in the properties window. I assume the difference is due to inaccessible files.

image

aleksey-hoffman avatar Jun 02 '22 22:06 aleksey-hoffman

Perhaps a similar handle to this Libuv implementation?

aleksey-hoffman avatar Jun 02 '22 22:06 aleksey-hoffman

i don't think that's possible cause getCompressedSize does not depend on CreateFileW. not directly at least. only GetCompressedFileSizeW is used and it has no option for file access mode. and i guess it would not ask for write permission anyway. perhaps you can use run as admin to achieve this.

xxoo avatar Jun 04 '22 16:06 xxoo