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: How do you get user's home directory
Topic Summary:
Created On: 19-Feb-2007 19:11
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.
Answer This question was answered by Pekka Mäkinen, on Monday, February 19, 2007 7:52 PM

Answer:
Maybe the home directory is mapped to a drive (root directory) for each user?

There is a separate environment variable for the drive, thus the following

string envstring = getenv("HOMEPATH")
string drivestring = getenv("HOMEDRIVE")
print drivestring envstring ""

produces correct values for me.
 19-Feb-2007 19:11
User is offline View Users Profile Print this message


Karen Hidalgo

Posts: 55
Joined: 4-Nov-2003

I would like to write a output file to a users home directory but I don't know how to get the environment variable %HOMEPATH%

When I try getenv("HOMEPATH") ---> I get:
\

When I try getenv("HOME") ---> I get:
C:\Program Files\Telelogic\DOORS_8.1\

Is there a way to get the user's home not DOORS home?

Thanks.

-------------------------
Karen Hidalgo<BR>Northrop Grumman - TASC<BR>karen.hidalgo@ngc.com
Report this to a Moderator Report this to a Moderator
 19-Feb-2007 19:18
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

Answer Answer
Maybe the home directory is mapped to a drive (root directory) for each user?

There is a separate environment variable for the drive, thus the following

string envstring = getenv("HOMEPATH")
string drivestring = getenv("HOMEDRIVE")
print drivestring envstring ""

produces correct values for me.

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/
Report this to a Moderator Report this to a Moderator
 19-Feb-2007 19:52
User is offline View Users Profile Print this message


Karen Hidalgo

Posts: 55
Joined: 4-Nov-2003

Thank you that worked.

Do you know a way to get this path:

\Documents and Settings\Username

Thanks.

-------------------------
Karen Hidalgo<BR>Northrop Grumman - TASC<BR>karen.hidalgo@ngc.com
Report this to a Moderator Report this to a Moderator
 20-Feb-2007 06:00
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

It seems to be the "USERPROFILE" environment variable (seems to be, because that is listed when I do run the "set" command from console).

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/

Edited: 20-Feb-2007 at 07:26 by Pekka Mäkinen
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.