CSC352 Walking a 2-Level Directory in C

From dftwiki3
Revision as of 07:28, 21 November 2013 by Thiebaut (talk | contribs) (Created page with "--~~~~ ---- =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 ; d...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

--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