Peter Swanson

Software Engineer

Full Stack Web Developer


Filesystem Map for Web Applications


Some problems in computer science are naturally recursive, like mapping the contents of a filesystem. Every directory must be checked for directories which in turn must be checked for directories in a potentially infinite hierarchy.



I set out to use recursion to quickly map directories stored on a server and display them to a web page.



This code allows a webserver's frontend to dynamically display its underlying filesystem.




Filesystem Map Demo



Root Directory: fs_demo/


fs_demo/

    - document.docx

    dir_2/

      - picture.png

      dir_2_1/

        - text.txt

        - movie.mp4

    dir_1/

      - hello_world.py