Salesforce

How to read the filesize when data is still being written to disk

« Go Back

Information

 
TitleHow to read the filesize when data is still being written to disk
URL NameWindows-filesize-when-data-is-still-being-written-to-disk
Article Number000189180
EnvironmentProduct: OpenEdge
Version: 10.2B08, 11.x, 12.x
OS: Windows Server 2012 R2 and later
Question/Problem Description
High disk access on certain client-temp files but OS dir listing shows the initial filesize.
On Windows the filesize is always 0 KB in file properties for new client-temp files.
Windows file sizes are wrong when they are still being updated.
On Windows an accurate file size is unavailable until the file handle is closed
Some client-temp filesizes are reported by OS tools but there is no client session with handles to these files

How to read the amount of client temp file data being written to disk to tune client memory buffer parameters
DBI files still being written to do not report an accurate file size until the file handle is closed at which time they are deleted.
When tuning DBI-files the filesize is not updated in disk so that the -Bt parameter can be tuned for more temp-table access in memory
Steps to Reproduce
Clarifying Information
NTFS filesystem
Error Message
Defect Number
Enhancement Number
Cause
Resolution
On Windows, the filesize is not updated in disk until the file handle is closed.  

While DBI files are a typical use case of this requirement, the following code example and can be customised to requirement to determine any file's size. For example, the code sample attached to this case extends to all client-temp files.
 
USING System*.*.
USING System.IO*.*.

DEFINE VARIABLE cFileName AS CHARACTER.
DEFINE VARIABLE i64FileSize AS INT64.
DEFINE VARIABLE myinfo AS System.IO.FileInfo.

cFileName = "c:\temp\DBI63824a63856".

myinfo = new System.IO.FileInfo(cFileName).
i64FileSize = myinfo:LENGTH.

MESSAGE i64FileSize
VIEW-AS ALERT-BOX INFO BUTTONS OK.

Another code example is provided in Article  4GL procedure to monitor temporary files growth  
Workaround
Notes
References to Other Documentation: 

The Four Stages of NTFS File Growth
https://blogs.technet.microsoft.com/askcore/2009/10/16/the-four-stages-of-ntfs-file-growth/

Windows Confidential: Just What Is ‘Size on Disk’?
https://technet.microsoft.com/en-us/library/hh148159.aspx
 
Keyword Phrase
Last Modified Date11/20/2020 7:15 AM

Powered by