Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 22-Dec-2005 18:31
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 24-Feb-2006 22:34
User is offline View Users Profile Print this message


David Cheung

Posts: 3
Joined: 19-May-2005

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.