Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File size limit
#1
What is the file size limit for this code? As written, I get strange file size values for multi GB files.
BigFileSize
Code:
Copy      Help
Dir d
if d.dir("$documents$\Very Large File.mov" 0) ;;if exists
,long Size=d.FileSize
,out Size

Thanks,
Matt
Matt B
#2
Dir.FileSize bug. The code must be
Member function Dir.FileSize
Code:
Copy      Help
function'long ;;Returns file size (number of bytes).
if(!hfind) end ES_INIT 2
if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
,ret GetFileOrFolderSize(FileName(1))
else
,ret fd.nFileSizeHigh<<32L+fd.nFileSizeLow

Or use function GetFileOrFolderSize.
#3
Thanks Gintaras,
Adding the "L" in the system code fixed the problem for some files, but not others. Using GetFileOrFolderSize worked for all cases.
Matt B
#4
Yes, still bug.
nFileSizeLow is unsigned in C++, but signed in QM.

Member function Dir.FileSize
Code:
Copy      Help
function'long ;;Returns file size (number of bytes).
if(!hfind) end ES_INIT 2
if(fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
,ret GetFileOrFolderSize(FileName(1))
else
,ret 0L+fd.nFileSizeHigh<<32+(0U+fd.nFileSizeLow)


Forum Jump:


Users browsing this thread: 1 Guest(s)