Reading Directories in Skill

Discussion in 'Cadence' started by Guenther Sohler, Jul 28, 2006.

  1. Hallo group,

    How can I read the contents of a directory and get the result into
    a skill list ?

    rds
     
    Guenther Sohler, Jul 28, 2006
    #1
  2. Guenther Sohler,

    From cdsFinder:

    getDirFiles(
    S_name
    )
    => l_strings

    Returns a list of the names of all files and directories, including .
    and .., in a directory.
     
    Suresh Jeevanandam, Jul 28, 2006
    #2
  3. Perfect

    Thank you very much
     
    Guenther Sohler, Jul 28, 2006
    #3
  4. Guenther Sohler

    Jimka Guest

    be careful, getDirFiles stacktraces if the directory does not
    exist, so you had better do the following.

    (when (isDir S_name)
    (getDirFiles s_name))
     
    Jimka, Jul 29, 2006
    #4
  5. Guenther Sohler

    John Gianni Guest

    Nice.

    % cds_root skill
    REPORTS:
    /path/to/cds/root/tools/IC5141_USR3

    % skill
    REPORTS:
    ("." ".." "dira" "dirb" "dirc")
    REPORTS:
    *Error* getDirFiles: nonexistent or permission denied - "/foo"
    REPORTS:
    ("." ".." "dira" "dirb" "dirc")
    %

    See the ancient MyUnixBrowse.il appslib SKILL which uses "isFile" and
    "isDir".
    See also the public ADE SKILL function drbBrowseFormCB() which brings
    up a browser that can be used as an example SKILL-based file &
    directory graphical browser.

    John Gianni
     
    John Gianni, Jul 31, 2006
    #5
  6. Just to complete this

    if( !isDir( t_dirName ) then
    printf( "%s is not a directory." t_dirName )
    else
    unless( isReadable( t_dirName )
    printf( "%s is an unreadable directory." ) ;
    )
    l_strings = getDirFiles( t_dirName )
    )
     
    Bernd Fischer, Aug 1, 2006
    #6
  7. John,

    Is there a method to get the Results Browser to bypass the "Browse
    Project Hierarchy" dialog box and open the results browser directly to
    the desired directory?

    Jason
     
    jason.dot.jacobs, Aug 3, 2006
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.