-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetUpSubstDrives.m
More file actions
84 lines (68 loc) · 1.93 KB
/
SetUpSubstDrives.m
File metadata and controls
84 lines (68 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
%% Unload substituted drives
system('subst s: /d');
system('subst o: /d');
system('subst p: /d');
% If "Invalid parameter" error, then the drives didn't exist as subst drives.
%% Load substituted drives
rootdir = fullfile(pwd,'..\data\17-merPPV\');
% rootdir = fullfile('C:\Users\clegaspi\Documents\MATLAB\data\13-merPPV\');
SFolder = 'Exp';
OFolder = 'INDOLib';
PFolder = 'GSLib';
if (rootdir(end) ~= '\')
rootdir = [rootdir, '\'];
end
if (~exist(rootdir,'dir'))
response = questdlg('This directory does not exist. Create?','Dir DNE','Yes','No','Yes');
if (strcmp(response,'Yes'))
mkdir(rootdir);
else
return;
end
end
if (~exist([rootdir,SFolder],'dir'))
mkdir([rootdir,SFolder]);
end
if (~exist([rootdir,OFolder],'dir'))
mkdir([rootdir,OFolder]);
end
if (~exist([rootdir,PFolder],'dir'))
mkdir([rootdir,PFolder]);
end
system(['subst s: "',rootdir,SFolder,'"']);
system(['subst o: "',rootdir,OFolder,'"']);
system(['subst p: "',rootdir,PFolder,'"']);
%% Unload substituted drives
% SECOND SET IN CASE NEEDED
system('subst j: /d');
system('subst k: /d');
system('subst l: /d');
% If "Invalid parameter" error, then the drives didn't exist as subst drives.
%% Load substituted drives
rootdir = fullfile(pwd,'..\data\PFH-13mer-N2Opt\');
SFolder = 'Exp';
OFolder = 'INDOLib';
PFolder = 'GSLib';
if (rootdir(end) ~= '\')
rootdir = [rootdir, '\'];
end
if (~exist(rootdir,'dir'))
response = questdlg('This directory does not exist. Create?','Dir DNE','Yes','No','Yes');
if (strcmp(response,'Yes'))
mkdir(rootdir);
else
return;
end
end
if (~exist([rootdir,SFolder],'dir'))
mkdir([rootdir,SFolder]);
end
if (~exist([rootdir,OFolder],'dir'))
mkdir([rootdir,OFolder]);
end
if (~exist([rootdir,PFolder],'dir'))
mkdir([rootdir,PFolder]);
end
system(['subst j: "',rootdir,SFolder,'"']);
system(['subst k: "',rootdir,OFolder,'"']);
system(['subst l: "',rootdir,PFolder,'"']);