When using Tcl_FSStat(someTcl_Obj, &statBuf) in a Tcl
extension compiled with MinGW, loading the extension in
a stock ActiveTcl tclsh, the file sizes that are in the
statBuf.size field are plain wrong.
Attached, you find the code for an extension
(filesize.c -> filesize.dll) defining a new Tcl command
[filesize]. The results from that command compared to
the regular [file size] command are:
% load filesize.dll
% filesize filesize.dll
1000 <== wrong value
% file size filesize.dll
As an alternative to the code in filesize.c, which has
the memory for statBuf allocated automatically, I used
Tcl_AllocStatBuf() to allocate the memory dynamically.
This did not make a difference.