Salome HOME
First publish of HEXABLOCKcomponant
[modules/hexablock.git] / src / HEXABLOCK / hexa_utils.cxx
1
2 // C++ : Fonctions utilitaires de Hexa
3
4 #include "hexa_base.hxx"
5
6 #include <sys/stat.h>
7
8 BEGIN_NAMESPACE_HEXA
9
10 // ======================================================== get_temp_name
11 pchar get_temp_name (cpchar format, pchar nomfic)
12 {
13    int nro = 0;
14    while (true)
15          {
16          nro ++;
17          sprintf (nomfic, format, nro);
18          
19          struct stat buffer;
20          int rep = stat (nomfic, &buffer);
21          if (rep<0) 
22             return nomfic;
23          }
24 }
25
26 END_NAMESPACE_HEXA