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 % special syntax for PCs if(ispc), new_path = strrep(['//' host old_path],'/','\'); % is this a non-NFS share, or any volume on Linux? elseif(strcmp(computer,'GLNX86') || strcmp(computer,'LNX86')... || (~strcmp(host,'tornado') && ~strcmp(host,'tempest'))), % is this the special case of ssdsdata on Mammoth? if (strcmp(getenv('HOSTNAME'),'mammoth') ... && strncmp(old_path,'/ssdsdata', 9)), new_path = old_path; else new_path = ['/hosts/' host old_path]; end % this is a NSF volume on a non-linux machine else new_path = ['/hosts/' host '/vol/vol0' old_path]; end