Hi All,
I have an application that stores setup data in a specific folder. When it starts it looks to see if that folder exists so it can load the current data. If not it creates the folder and saves default settings. My script was working just fine last week, and today for some reason, it doesn't recognize the folder that it creates as a directory. Specifically if I call d=dir;, and i is the instance of the folder (that I can see in Windows Explorer), then d(i).name is the name of the folder, but d(i).isdir returns a 0. Here's some of the code:
d = dir;create_data_folder = 1;for i=1:length(d) fprintf('The name is %s and isdir is %d\n',d(i).name,d(i).isdir) if d(i).isdir if strcmp(d(i).name, 'Folder Name') create_data_folder = 0; fprintf('Starting up.\n'); end endend
After this, if create_data_folder is 1, it uses a mkdir command to create the folder "Folder Name". Once it's there, sometimes it recognizes it as a directory and sometimes it doesn't! I'd appreciate it if anyone has any ideas. Thanks.
Glenn
Best Answer