Skip to content

Instantly share code, notes, and snippets.

@awhite40
Forked from tonyfast/filelist.m
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save awhite40/21a7d5d13f8e44ecd72c to your computer and use it in GitHub Desktop.

Select an option

Save awhite40/21a7d5d13f8e44ecd72c to your computer and use it in GitHub Desktop.
d = cd
paths = strsplit( genpath( d ), ';' );
fo = fopen( 'list.txt', 'w')
for pp = 1 : numel( paths )
ff = dir( paths{ pp } )
[~,b] = fileparts(paths{pp})
if numel( ff ) > 0 & numel(strfind(paths{pp},'.git')) == 0
b = arrayfun( @(x)x.name(1)~='.' & ~logical( x.isdir), ff(:))
formatSpec = '%s %s %s %s\r\n';
fprintf( fo,formatSpec, horzcat( paths{pp}, filesep),ff(b).name, '\n');
end
end
fclose(fo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment