Biomodèles/Biomodels
SCILAB 3.0 PAS A PAS
SCILAB 3.0 STEP-TO-STEP

Jacques-Deric Rouault

Laboratoire de Neurobiologie de l'Apprentissage, de la Mémoire et de la Communication. CNRS UMR 8620, Bat. 446, Université Paris-Sud, F91400 Orsay

Orscilab
ORSCILAB

30 LA GESTION DES FICHIERS
30 FILE MANAGEMENT
30.4 Acces interactif / Interactive access
Version 2.1.3 du 16 février 2005 / Version 2.1.3, February 16th 2005
Biomodèles/Biomodels N°1 pp 0x-0y Décembre 2004 December 2004

Retour à la Table générale / Return to the General table
Index général / General index
Passage à la section suivante 30.5 / Next section 30.5

a
tk_getdir
b
tk_getfile
c
tk_savefile
d
xgetfile

La fonction tk_getdir ouvre une fenetre interactive qui permet de désigner un répertoire.
The function tk_getdir opens an interactive window which allows the user to design a directory.

// PROGRAMME SPAS300401 tk_getdir
repdir = tk_getdir (title="Nom de la fenetre/Name of the window"),

Ch30Sc04-Fig01

Il est alors possible de se déplacer dans l'arborescence des volumes et des répertoires. Le système part du répertoire par défaut. La fenetre est fermée quand on clique sur OK. Si on clique sur Annuler, une chaine vide  est retournée.
Then it is possible to move in the tree of the volumes and directories.  The system begins with the default directory. The window is closed when clicking on OK. A null string is returned if clicking on Cancel.

Ch30Sc04-Fig02

Il est possible de préciser le répertoire de départ.
It is possible to give the beggining directory.

// PROGRAMME SPAS300402 tk_getdir
repdir = tk_getdir ("K:/Biomodeles/Scilab_Pasapas/Vers2.1",title="Nom de la fenetre/Name of the window"),

Ch30Sc04-Fig03

En fait le répertoire de départ se situe au niveau du volume désigné.
In fact, the beggining directory is the volume of the directory defined.

La fonction tk_getfile ouvre une fenetre interactive qui permet de désigner un fichier en parcourant les répertoires.
La fenetre est fermée quand on clique sur OK. Si on clique sur Annuler, une chaine vide  est retournée.
The function tk_getfile opens an interactive window which allows the user to design a file in moving among the directories. The window is closed when clicking on OK. A null string is returned if clicking on Cancel.

// PROGRAMME SPAS300403 tk_getfile
fichierfile = tk_getfile (title="Nom de la fenetre/Name of the window"),

Ch30Sc04-Fig04

Ch30SC04-Fig05

Il est possible de restreindre la liste des fichiers sélectionnables.
It is possible to restrain the list of selectionnable files.

// PROGRAMME SPAS300404 tk_getfile
fichierfile = tk_getfile ("*.log",title="Nom de la fenetre/Name of the window"),


Ch30Sc04-Fig06

Il est possible de préciser le répertoire de départ.
It is possible to give the beggining directory.

// PROGRAMME SPAS300405 tk_getfile
fichierfile = tk_getfile ("*.bat","C:\Program files\Scilab-3.0",title="Nom de la fenetre/Name of the window"),


Ch30Sc04-Fig07

La fonction tk_savefile ouvre une fenetre interactive qui permet de désigner un fichier en parcourant les répertoires. On peut choisir un nom de fichier déjà existant ou taper le nom d'un nouveau fichier dans la case Nom du fichier. La fenetre est fermée quand on clique sur OK. Si on clique sur Annuler, une chaine vide  est retournée.
The function tk_savefile opens an interactive window which allows the user to design a file in moving among the directories. It is possible to choose the name of an existing file or to enter the name of a new file in the box File name. The window is closed when clicking on OK. A null string is returned if clicking on Cancel.

// PROGRAMME SPAS300406 tk_savefile
fichierfile = tk_savefile (title="Nom de la fenetre/Name of the window"),

Ch30Sc04-Fog08

En tapant toto.txt dans la case Nom du fichier, la chaine K:/Biomodeles/Scilab_Pasapas/toto.txt est retournée.
In striking toto.txt in the box File name, the string K:/Biomodeles/Scilab_Pasapas/toto.txt is returned.

Ch30Sc04-Fig09

Il est possible de restreindre la liste des fichiers sélectionnables.
It is possible to restrain the list of selectionnable files.

// PROGRAMME SPAS300407 tk_savefile
fichierfile = tk_savefile ("*.txt",title="Nom de la fenetre/Name of the window"),


Ch30Sc04-Fig10

Attention : si on choisit un fichier qui existe déjà, le nom du fichier est pris avec son suffixe. Si on choisit de créer un nouveau fichier, il faut préciser le suffixe avec le nom du fichier.
Caution: if an existing file is chosen, the name of the file is taken with its suffix. If the creation of a new file is chosen, the suffix has to be explicited with the name of the file.


Il est possible de préciser le répertoire de départ.
It is possible to give the beggining directory.


// PROGRAMME SPAS300408 tk_savefile
fichierfile = tk_savefile ("*",
"C:\Program files\Scilab 3.0",title="Nom de la fenetre/Name of the window"),

NB : Cette option ne fonctionne pas correctement.
Note : This option does not work correctly.

La fonction xgetfile.
The function xgetfile

// PROGRAMME SPAS300409 xgetfile
fichierfile = xgetfile (title="Nom de la fenetre/Name of the window"),



// PROGRAMME SPAS300410 xgetfile
fichierfile = xgetfile ("*.log",title="Nom de la fenetre/Name of the window"),



// PROGRAMME SPAS300411 xgetfile
fichierfile = xgetfile ("*.bat","C:\Program files\Scilab-3.0",title="Nom de la fenetre/Name of the window"),




Retour à la Table générale / Return to the General table
Index général / General index
Passage à la section suivante 30.5 / Next section 30.5