CSC352 Walking a 2-Level Directory in C
--D. Thiebaut (talk) 07:28, 21 November 2013 (EST)
Create a test structure
Directory structure
- Using bash, from the command line, create a similar structure:
for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f ; do for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f ; do echo ${i}${j}; mkdir -p ${i}/${i}${j} done done
Create fake files
- create files using the "touch" command
for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f ; do for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f ; do echo ${i}${j}; touch ${i}/${i}${j}/image_${i}${j}.jpg touch ${i}/${i}${j}/image${j}${i}.png done done