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: File Path Separators Bug
Topic Summary: Nasty bug in DOORS file path separators and DOORSHOME
Created On: 31-Jul-2007 12:13
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.
 31-Jul-2007 12:13
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

I just found a very interesting bug to do with file path separators.
If you have a forward slash and a back slash together in a path name, doors accepts it.
So, the following all work correctly even though the last two should not.

print readFile("c:\\test.dxl")
print readFile("c:/test.dxl")
print readFile("c:/\\test.dxl")
print readFile("c:\\/test.dxl")

This bug has been around since the year dot, because there is a lot Telelogic DXL code that relies on this bug being there to work.

The environment variable DOORSHOME is initialised to "C:\Program Files\Telelogic\DOORS_8.1\".
Note the trailing file separator (backslash). This is used to initialise a global variable in init.dxl as follows:

string doorsHome = (getenv "DOORSHOME") ""

Then the menu creation functions in formal.dxl and other files use this variable to construct file paths as follows:

createItem(alwaysOn, "View...", 'V', null, modKeyCtrl, null ,null, "View an existing baseline of the module.",null, doorsHome "/lib/dxl/standard/baseline/openBaseline.dxl")

You can see from this example that the actual path to the dxl file is as follows, with an extra file separator before the lib folder:

"C:\Program Files\Telelogic\DOORS_8.1\/lib/dxl/standard/baseline/openBaseline.dxl".

Telelogic have logged this as a defect with case ID SH5018616.

I cannot see this bug ever being fixed because it would affect everyone's DXL.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 19-Feb-2008 06:25
User is offline View Users Profile Print this message


Shyam Sundar

Posts: 8
Joined: 26-Jul-2006

Hello Tony,
I am just curious to know if the command "readFile" opens the stream that has to be explicitly closed later !
In other words, does readFile() command "read lock" the stream which needs to be closed later?

Regards,
Shyam

-------------------------
Regards,
Shyam
Report this to a Moderator Report this to a Moderator
 19-Feb-2008 09:20
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Bit off topic, but hey...

readFile() does not leave a stream open.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.