Posts: 175
Threads: 43
Joined: Jun 2004
What is the file size limit for this code? As written, I get strange file size values for multi GB files.
BigFileSize
Dir d
if d.dir("$documents$\Very Large File.mov" 0) ;;if exists
,long Size=d.FileSize
,out Size
Thanks,
Matt
Matt B
Posts: 12,147
Threads: 143
Joined: Dec 2002
Dir.FileSize bug. The code must be
Member function
Dir.FileSize
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.
Posts: 175
Threads: 43
Joined: Jun 2004
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
Posts: 12,147
Threads: 143
Joined: Dec 2002
Yes, still bug.
nFileSizeLow is unsigned in C++, but signed in QM.
Member function
Dir.FileSize
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)