Does not work for linux, because it uses the function "ismac" instead of isunix.
Additionally, I do not see why the wildcard should be set to an empty string on a mac, a '*' would make more sense, right?
Why not use the Matlab-original function 'what'? At least for Matlab-related files, it gives you exactly what you want to do with getfilenames.
it works well in Matlab2008a(7.6).Thanks for sharing!
28 Aug 2007
Best thing since sliced bread.
22 Jul 2005
Very good. Saved me a lot of time.
15 Aug 2002
Nice file, but one request - Can you rewrite this so that instead of CD-ing between directories, your recursive calls to DIR include the right path information? This way if the program errors or is halted (say, with cntrl-c), you don't end up in some strange directory. This would also make the program more robust to potential network problems, too (eg, such as getting "abandoned" in a stale filesystem if a network drive is suddenly disconnnected after you've CD-ed into it).
If you can do that, I'd give this file a 4 or 5!
07 Apr 2009
Removed the cd to other folders per suggestion. Now, it stays in the folder where it was called. Also added ability to simply return all subfolder names only if a single root folder argument is passed.
16 Apr 2009
Bug fix on line 36. Changed 'cd' to 'root'. Thanks Elena.
28 May 2009
Thanks to Kenn Sebesta. His Comments:
Hi, I fixed getfilenames.m to work with Mac. I'm betting it works with
Linux now, too.
The secret ingredient was `fullfile`, which lets Matlab decide for
itself how to format dir calls.