Component index
Section index

Component walkfs


Search

	/*
	    walkfs is used to browse into a directory. You can use this to
	    extract some file from a sub-directory. At each step, you have enough
	    information to tell if you continue, go deeper and so on.
	*/
	<mod>
	static void sample_walkfs()
	{
	    <call walkfs>("/tmp");
	    <f onefile>
	        // One directory entry, this can be a file or a directory
	        printf ("%*.*s%s\n",depth*8,depth*8,"",basename);
	    </f>
	    <f recurse>
	        // We do not go too deep
	        return depth < 2;
	    </f>
	    </call>
	}
	</mod>