function new_path = MBARI_path(old_path) % Takes a pc or unix path, and adjusts it for the local environment % Adjusts for peculiarities of tornado and tempest Network % Appliance file servers % % for example, on a pc, the path will look like: % //tornado/Diatom/CIMT/Configuration/OCR3000 % or //foo/bardir/etc % on most unix boxes, the path will become: % /hosts/tornado/vol/vol0/Diatom/CIMT/Configuration/OCR3000 % or /hosts/foo/bardir/etc % on linux boxes, the path will become: % /hosts/tornado/Diatom/CIMT/Configuration/OCR3000 % or /hosts/foo/bardir/etc % % Created 05/26/2004 % by Michael Godin % % Turn '\'s into '/'s old_path = strrep(old_path,'\\','/'); % Stip off leading double slash if this a pc file old_path = strrep(old_path,'//',''); % Stip off '/hosts/' if this a unix file old_path = strrep(old_path,'/hosts/',''); % Separate off the host name [host, old_path] = strtok(old_path, '/'); % get rid of 'vol/vol0/ if(strncmp(old_path, '/vol/vol0', 9)), old_path = old_path(10:end); end % Step 4: rebuild if(ispc), new_path = strrep(['//' host old_path],'/','\'); elseif(strncmp(system_dependent('getos'),'Linux',5)... || (~strcmp(host,'tornado') && ~strcmp(host,'tempest'))), new_path = ['/hosts/' host old_path]; else new_path = ['/hosts/' host '/vol/vol0' old_path]; end