-
-
Notifications
You must be signed in to change notification settings - Fork 12
getCompressedSize
xiao edited this page Nov 20, 2025
·
2 revisions
get the on disk size of an NTFS compressed file. if the file is not compressed, these functions will return the same value as the file's real size. if the file does not exist or is inaccessible, the return value will be null.
callback:
fswin.ntfs.getCompressedSize(file, callback);async:
var result = await fswin.ntfs.getCompressedSizeAsync(file);sync:
var result = fswin.ntfs.getCompressedSizeSync(file);-
fileis a string that specifies the path to a file -
callbackis a function that takes only one argumentresult -
resultis a number to indicate the commpressed size of the file or null when failed.
var fswin = require('fswin');
var file = 'd:\\testfile.txt';
//sync
console.log('the compressed file size is: ' + fswin.ntfs.getCompressedSizeSync(file) + ' Bytes');
//async
console.log(fswin.ntfs.getCompressedSize(file, function (result) {
console.log('the compressed file size is: ' + result + ' Bytes');
}) ? 'job queued' : 'failed to queue job');