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

Function file_dirscan_impl

v2/engine/filesys.c:266–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264 */
265
266static void file_dirscan_impl( OBJECT * dir, scanback func, void * closure )
267{
268 file_info_t * const d = file_query( dir );
269 if ( !d || !d->is_dir )
270 return;
271
272 /* Lazy collect the directory content information. */
273 if ( list_empty( d->files ) )
274 {
275 if ( DEBUG_BINDSCAN )
276 printf( "scan directory %s\n", object_str( d->name ) );
277 if ( file_collect_dir_content_( d ) < 0 )
278 return;
279 }
280
281 /* OS specific part of the file_dirscan operation. */
282 file_dirscan_( d, func, closure );
283
284 /* Report the collected directory content. */
285 {
286 LISTITER iter = list_begin( d->files );
287 LISTITER const end = list_end( d->files );
288 for ( ; iter != end; iter = list_next( iter ) )
289 {
290 OBJECT * const path = list_item( iter );
291 file_info_t const * const ffq = file_query( path );
292 /* Using a file name read from a file_info_t structure allows OS
293 * specific implementations to store some kind of a normalized file
294 * name there. Using such a normalized file name then allows us to
295 * correctly recognize different file paths actually identifying the
296 * same file. For instance, an implementation may:
297 * - convert all file names internally to lower case on a case
298 * insensitive file system
299 * - convert the NTFS paths to their long path variants as that
300 * file system each file system entity may have a long and a
301 * short path variant thus allowing for many different path
302 * strings identifying the same file.
303 */
304 (*func)( closure, ffq->name, 1 /* stat()'ed */, &ffq->time );
305 }
306 }
307}
308
309
310static void free_file_info( void * xfile, void * data )

Callers 1

file_dirscanFunction · 0.85

Calls 6

file_queryFunction · 0.85
object_strFunction · 0.85
list_beginFunction · 0.85
list_endFunction · 0.85
file_dirscan_Function · 0.70

Tested by

no test coverage detected