$LastChangedDate: 27-Juil-2011 $

# CL_path

Looks for a file in directories

## Calling Sequence

       [path] = CL_path(name [,directories])

## Description

- Looks for a file in a list of directories. Only the path of the first file found is returned.

  If directories is absent, the variable %CL_PATH is used if it is defined. If %CL_PATH is not defined, the working directory is considered.

  An error is raised if the file is not found.

  Note : Wild card '*' can be used at the end of a directory to look in all sub-directories (only one level)

## Parameters

name:

  (string) Name of file to be looked for (1x1)

directories:

  (string, optional) Directories to be searched (1xN) (default is %CL_PATH or '.'

path:

  (string) File path (1x1)

## Authors

- CNES - DCT/SB

## Examples

    dirlist = ['.', '/users/scripts', 'D:/data' , 'D:/data/*'];
    // Looks for script toto.sce in the given directories :
    CL_path('toto.sce', dirlist);
    // loads script using implicit directory list:
    %CL_PATH = ['.', '/users/scripts', 'D:/data'];
    exec(CL_path('toto.sce'));
    // Absolute file path:
    abs_path = fullpath(CL_path('toto.sce'))