mIRC Homepage
Posted By: feud $file().size max? - 18/06/04 09:17 PM
just wondering if anyone knows the max file size that $file() can handle. i have an 8gb backup file that mirc says is 158mb.
Posted By: starbucks_mafia Re: $file().size max? - 18/06/04 10:58 PM
I think it uses an unsigned integer so on a 32 bit system it's going to be 4294967296 bytes (4GB). mIRC has probably wrapped around twice before it came up with 158MB.
Posted By: qwerty Re: $file().size max? - 19/06/04 12:11 AM
For files of size between 2 and 4GB, $file().size returns a negative number. Having this in mind, one can double the max supported file size: the following alias works correctly with files of up to 4GB (after that it wraps):
Code:
alias filesize1 return $calc($replace($file($1),-,2^32-))
With the help of COM objects, it's possible to make an alias that supports all sizes:
Code:
alias filesize2 {
  if !$isfile($1) { return }
  var %a = fso $+ $ticks, %b = fsize $+ %a
  .comopen %a Scripting.FileSystemObject
  if $comerr { return }
  if $com(%a,GetFile,1,bstr*,$1,dispatch* %b) && $com(%b) {
    .comclose %a $com(%b,Size,2)
    %a = $com(%b).result
    .comclose %b
    return $gettok(%a,1,46)
  }
  .comclose %a
}
Posted By: feud Re: $file().size max? - 24/06/04 10:35 PM
thanks
Posted By: Mentality Re: $file().size max? - 07/07/04 09:53 PM
For the sake of anyone browsing this forum etc. I thought I'd post that the file().size limitation has been 'fixed' in mIRC 6.16 smile (See Item 35 of versions.txt)

Regards,
© mIRC Discussion Forums