![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Is it a Directory or is it a File Topic Summary: Created On: 22-Dec-2005 18:31 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I got some input from Roy-David Bond, some from this forum, and other's I came up with myself.
I'm writting functions to determine if a string variable represents an existing Windows File, and existing Directory, or neither. See the attached DXL. There are two functions using different techniques to determine if its a directory, and two different functions to determine if its a file. I desire that existing drives that are not accessible, such as no CD in the "D:" drive, should return false. That is, its a directory if I could view its contents. For this test, the C: drive exists, the D: drive exists but there is no CD in it; file XXX doesn't exist, file T1 has zero bytes, and file T2 has one byte in it. Looking at the results, I notice that: the Stat function incorrectly detects the "D:" drive but the "directory" command incorrectly recognizes an existing file as a directory. The Stat function incorrectly identifies the "D:" drive as a file ..err.. the "D:\" as a file. The file Exists function appears to correctly identify a file as a file, but I believe its inefficient. I think I need to abandon both Stat functions, and the directory function should first return a false if the named item survives the File Exists check. Did I cover everything? - Louie |
|
![]() |
|
![]() |
|
Hi Louie:
I've tested your script. I found out that the fIsDir_Dir cannot differentiate a file within in a directory and a directory within a directory.
Just want to let you know.
Cheers!
David Cheung
|
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Is it a Directory or is it a File
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.