![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Type of 'directory' Topic Summary: Created On: 20-Dec-2005 20:27 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
In chapter Files and Streams there is a "for NameFile in directory(NameDir) do" loop. Does anybody know what type of data is a "directory(NameDir)", such that I can do this:
?DefineDir? dir = directory(NameDir) if (null dir) then its not a directory else look at the files in the directory. - Louie |
|
![]() |
|
![]() |
|
Are you just trying to find out if something is a directory? If so, there's the stat type, and a function directory() that gives a boolean back.
Example from the manual: Stat s string filename = "/etc" s = create filename if (!null s && directory s) ack filename " is a directory!" Or maybe you're talking about something else ![]() -Chris |
|
![]() |
|
![]() |
|
There are two forms of the directory perm:
Directory__ directory(string) // thats a double underscore bool directory(Stat) ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
Directory__ works thanks. I can set it and check whether or not its null. This gives the same results as Jones.
But WAIT!!! This doesn't really work. If the directoryname is "D:\" then both the above schemes return true whether or not you've got a CD in the drive. So what I was really after is "Is it a directory to which I can see the contents". That hokey algorithm looks as follows: noError() for NameFile in directory(NameDir) do { break } string ErrMess = lastError() // Its a directory if there was no DXL error. if (!null ErrMess) print "\t" NameDir "\t" ErrMess IsaDir = (null ErrMess) // that's not "Isuldur" ![]() - Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Type of 'directory'
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.