source: MML/trunk/machine/SOLEIL/StorageRing/insertions/IDStarter/idSaveStruct.m @ 17

Last change on this file since 17 was 17, checked in by zhangj, 10 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 899 bytes
Line 
1function res = idSaveStruct(structToSave, fileNameCore, idName, dispData)
2% Before saving, this calls functions written by L.N. and performing the
3% file name decorations
4
5res = '';
6% If the filename contains a directory then make sure it exists
7
8% Save the structure into a file, if necessary
9if strcmp(fileNameCore, '') ~= 0
10    % Claim error
11    printf('File name is not specified');
12end
13
14FileName = appendtimestamp(fileNameCore);
15%DirectoryName = getfamilydata('Directory','HU80_TEMPO');
16DirectoryName = getfamilydata('Directory',idName);
17DirStart = pwd;
18[DirectoryName, ErrorFlag] = gotodirectory(DirectoryName);
19
20if ErrorFlag == 0
21    save(FileName,'-struct', 'structToSave');
22    res = FileName;
23else
24    % Claim error
25    errStr = strcat('Can not locate the directory ', DirectoryName);
26    printf(errStr);
27end
28cd(DirStart);
29
30if dispData ~= 0
31        fprintf('Sauvegarde:  %s\n', FileName);
32end
33
34
Note: See TracBrowser for help on using the repository browser.