MCPcopy Create free account
hub / github.com/MariaDB/server / GetFileLength

Method GetFileLength

storage/connect/filamvct.cpp:139–166  ·  view source on GitHub ↗

/ VCT GetFileLength: returns file size in number of bytes. */ This function is here to be accessible by VECFAM and VMPFAM. */ /

Source from the content-addressed store, hash-verified

137/* This function is here to be accessible by VECFAM and VMPFAM. */
138/***********************************************************************/
139int VCTFAM::GetFileLength(PGLOBAL g)
140 {
141 if (Split) {
142 // Get the total file length
143 char filename[_MAX_PATH];
144 PCSZ savfile = To_File;
145 int i, len = 0;
146
147 // Initialize the array of file structures
148 if (!Colfn) {
149 // Prepare the column file name pattern and set Ncol
150 Colfn = (char*)PlugSubAlloc(g, NULL, _MAX_PATH);
151 Ncol = ((PVCTDEF)Tdbp->GetDef())->MakeFnPattern(Colfn);
152 } // endif Colfn
153
154 To_File = filename;
155
156 for (i = 0; i < Ncol; i++) {
157 snprintf(filename, _MAX_PATH, Colfn, i+1);
158 len += TXTFAM::GetFileLength(g);
159 } // endfor i
160
161 To_File = savfile;
162 return len;
163 } else
164 return TXTFAM::GetFileLength(g);
165
166 } // end of GetFileLength
167
168/***********************************************************************/
169/* Reset read/write position values. */

Callers

nothing calls this directly

Calls 3

PlugSubAllocFunction · 0.85
MakeFnPatternMethod · 0.80
GetFileLengthFunction · 0.70

Tested by

no test coverage detected