1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2009 - DIGITEO - Pierre MARECHAL <pierre.marechal@scilab.org>
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution. The terms
7 // are also available at
8 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12 function matrix_out = atomsLoadInstalledMat(allusers)
16 // Init the output argument
17 // =========================================================================
20 // Check number of input arguments
21 // =========================================================================
24 error(msprintf(gettext("%s: Wrong number of input argument: %d expected.\n"),"atomsLoadInstalled",1));
27 // Check number of input argument type
28 // =========================================================================
30 if (type(allusers)<>4) & (type(allusers)<>10) then
31 error(msprintf(gettext("%s: Wrong type for input argument #%d: A boolean or a string expected.\n"),"atomsLoadInstalled",1));
34 // Define the path of the file that will record the change according to
35 // the "allusers" value
36 // =========================================================================
38 if (type(allusers)==10) & (allusers=="all") then
39 installed_file = [ pathconvert(SCI+"/.atoms/installed.bin",%F); pathconvert(SCIHOME+"/atoms/installed.bin",%F) ];
41 installed_file = pathconvert(SCI+"/.atoms/installed.bin",%F);
43 installed_file = pathconvert(SCIHOME+"/atoms/installed.bin",%F);
46 // Loop on installed files
47 // =========================================================================
49 for i=1:size(installed_file,"*")
51 // Does the file exist,
52 // If yes, load the tree
53 // If not, the job is done for this file
54 // ---------------------------------------------------------------------
56 if fileinfo(installed_file(i)) <> [] then
57 load(installed_file(i),"installed_mat");
62 matrix_out = [ matrix_out ; installed_mat ];