Author Topic: Linux - Boilerplate Example Recursive Directory Listing  (Read 2044 times)

Offline Zefferon

  • Jr. Member
  • *
  • Posts: 13
Linux - Boilerplate Example Recursive Directory Listing
« on: January 23, 2015, 08:18:45 PM »
These two demos show how to recursively list a Linux directory and all of its subdirectories.

Both demos make use of the PathLog.mac macro include file and the PathLog.asm module of the
FileSystem Library of the Shallizar Nasm Linux Runtime.

The first demo lists a directory and all of its subdirectories as directories only.
Each directory is listed as a relative path to the parent directory.

The second demo lists all the directories and their files.

The PathLog module has built-in iterators. This makes it very easy to go through a dir or file list.


USING THE PathLog FUNCTION IN YOUR PROGRAMS
You can use the PathLog module with your own program by including PathLog.mac in your source file:
    %include "PathLog.mac"
And linking to the PathLog module:
    ld -o YourProgram YourProgram.o ~/nasm/Linux/Shallizar/Runtime/FileSystem/PathLog.o

The path provided to ld will be that if you unzipped the tarball into your personal directory.


The webpage is:
http://www.shallizar.com/nasmcollection/Linux/Shallizar/Apps/Boilerplate/DirTree.html
Each file can be downloaded individually.

The homepage is:
www.shallizar.com

The files can also be downloaded as a tarball:
http://www.shallizar.com/nasmcollection/Linux/nasmcoldnldlinux.html