MCPcopy Create free account
hub / github.com/boostorg/build / try_file_query_root

Function try_file_query_root

v2/engine/filent.c:210–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208 */
209
210int try_file_query_root( file_info_t * const info )
211{
212 WIN32_FILE_ATTRIBUTE_DATA fileData;
213 char buf[ 4 ];
214 char const * const pathstr = object_str( info->name );
215 if ( !pathstr[ 0 ] )
216 {
217 buf[ 0 ] = '.';
218 buf[ 1 ] = 0;
219 }
220 else if ( pathstr[ 0 ] == '\\' && ! pathstr[ 1 ] )
221 {
222 buf[ 0 ] = '\\';
223 buf[ 1 ] = '\0';
224 }
225 else if ( pathstr[ 1 ] == ':' )
226 {
227 if ( !pathstr[ 2 ] )
228 {
229 }
230 else if ( !pathstr[ 2 ] || ( pathstr[ 2 ] == '\\' && !pathstr[ 3 ] ) )
231 {
232 buf[ 0 ] = pathstr[ 0 ];
233 buf[ 1 ] = ':';
234 buf[ 2 ] = '\\';
235 buf[ 3 ] = '\0';
236 }
237 else
238 {
239 return 0;
240 }
241 }
242 else
243 {
244 return 0;
245 }
246
247 /* We have a root path */
248 if ( !GetFileAttributesExA( buf, GetFileExInfoStandard, &fileData ) )
249 {
250 info->is_dir = 0;
251 info->is_file = 0;
252 info->exists = 0;
253 timestamp_clear( &info->time );
254 }
255 else
256 {
257 info->is_dir = fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
258 info->is_file = !info->is_dir;
259 info->exists = 1;
260 timestamp_from_filetime( &info->time, &fileData.ftLastWriteTime );
261 }
262 return 1;
263}
264
265void file_query_( file_info_t * const info )
266{

Callers 1

file_query_Function · 0.85

Calls 3

object_strFunction · 0.85
timestamp_clearFunction · 0.85
timestamp_from_filetimeFunction · 0.85

Tested by

no test coverage detected