Reading Directories in Skill

G

Guenther Sohler

Guest
Hallo group,

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

rds
 
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
Guenther Sohler wrote:
Hallo group,

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

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

(when (isDir S_name)
(getDirFiles s_name))



Suresh Jeevanandam wrote:
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
Guenther Sohler wrote:
Hallo group,

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

rds
 
Jimka wrote:
be careful, getDirFiles stacktraces if the directory does not
exist, so you had better do the following.
Nice.

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

% skill
getDirFiles("/tmp")
REPORTS:
("." ".." "dira" "dirb" "dirc")

getDirFiles("/foo")
REPORTS:
*Error* getDirFiles: nonexistent or permission denied - "/foo"

(when (isDir "/foo") (getDirFiles "/foo"))
REPORTS:
nil

(when (isDir "/tmp") (getDirFiles "/tmp"))
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
--
Nothing stated by me here is prior sanctioned nor reviewed by anyone.
 
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 )
)


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

(when (isDir S_name)
(getDirFiles s_name))



Suresh Jeevanandam wrote:
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
Guenther Sohler wrote:
Hallo group,

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

rds
 
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

John Gianni wrote:
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.
 

Welcome to EDABoard.com

Sponsor

Back
Top