#!/usr/bin/octave -qf % Copyright 2005 Daniel Cer (daniel.cer@cs.colorado.edu) % % This work is licensed under the Creative Commons Attribution-NonCommercial- % ShareAlike License. To view a copy of this license, visit % http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to % Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, % 94105, USA. if nargin != 1 fprintf(stderr, "Usage:\n\t%s (directory to list)\n", program_name); exit(-1); endif [entries,err,msg] = readdir(argv{1}); if err != 0 fprintf(stderr, "Error: %s\n", msg); exit(-1); endif printf("Contents of \"%s\"\n", argv{1}); for i=1:rows(entries) printf("\t%s\n", entries(i,:)); endfor