ATOMS: cosmetic
[scilab.git] / scilab / modules / atoms / macros / atoms_internals / atomsAUWriteAccess.sci
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2009 - DIGITEO - Pierre MARECHAL <pierre.marechal@scilab.org>
3 //
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
9
10 // Internal function
11
12 // Add an URL to the list of repositories, and returns
13
14 function res = atomsAUWriteAccess()
15         
16         res = %F;
17         
18         // Cache
19         if isdef("ATOMSALLUSERSWRITEACCESS") then
20                 res = ATOMSALLUSERSWRITEACCESS;
21                 return;
22         end
23         
24         // Physical test
25         try
26                 atoms_system_directory  = atomsPath("system" ,"allusers");
27                 atoms_install_directory = atomsPath("install","allusers");
28                 
29                 
30                 if isdir(atoms_system_directory) then
31                         mputl("dummy",atoms_system_directory+"dummy");
32                         mdelete(atoms_system_directory+"dummy");
33                 else
34                         if mkdir(atoms_system_directory)<>1 then
35                                 return;
36                         end
37                         mputl("dummy",atoms_system_directory+"dummy");
38                         mdelete(atoms_system_directory+"dummy");
39                 end
40                 
41                 mputl("dummy",atoms_install_directory+"dummy");
42                 mdelete(atoms_install_directory+"dummy");
43                 
44                 res = %T;
45                 
46         catch
47         end
48         
49 endfunction