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: Delete (non doors) directory
Topic Summary: Is there a way to delete a non doors directory from dxl? (for example c:/temp/)
Created On: 1-Aug-2008 19:02
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.
 1-Aug-2008 19:02
User is offline View Users Profile Print this message


Kane Grzebielski

Posts: 19
Joined: 29-May-2008

Is there a way to delete a non doors directory from dxl? (for example c:/temp/)
Report this to a Moderator Report this to a Moderator
 4-Aug-2008 08:23
User is offline View Users Profile Print this message


Paul Howstan

Posts: 47
Joined: 27-Sep-2006

Hi,

You can do it using the system function which allows you to send DOS commands.

Something like:

system("del c:\\temp")

Look at system in the DXL help manual for notes on its use.

Paul
Report this to a Moderator Report this to a Moderator
 4-Aug-2008 12:56
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

deleteFile(string filepath)

Check to make sure the filepath exists using Stat.

Stat s = create(string filepath)
if(!null(s)) {
deleteFile(string filepath)
}

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 4-Aug-2008 17:26
User is offline View Users Profile Print this message


Kane Grzebielski

Posts: 19
Joined: 29-May-2008

the system method doesn't work. An error message pops up saying that creation of the process failed.

The other method using deleteFile doesn't work either...probably because it's used to delete files not directories.

Edited: 4-Aug-2008 at 17:28 by Kane Grzebielski
Report this to a Moderator Report this to a Moderator
 4-Aug-2008 17:50
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Following command will delete H:temp directory

system "cmd /c rmdir H:\\temp"


--------------------------------------------
Either of these two command will delete a.txt from h drive.

system("cmd /c del h:\\a.txt")
deleteFile "h:\\A.TXT"


None of the statement gives a dxl error message if the file/direcotry exists or doesn't exists.

Edited: 4-Aug-2008 at 19:24 by ron lewis
Report this to a Moderator Report this to a Moderator
 20-Oct-2008 00:11
User is offline View Users Profile Print this message


anant mitra

Posts: 50
Joined: 27-Jul-2007

How do you handle the case where the directory name contains spaces? For example, if the directory to be deleted is C:\Temp\test for dir, and this directory further contains sub-directories, how do we delete them with a single command?

I tried system "cmd /c rmdir/S C:\\Temp\\test for dir"

It thought test, for, dir are 3 separate directories and tried looking for those 3 directories.

Thanks.

Edited: 20-Oct-2008 at 00:22 by anant mitra
Report this to a Moderator Report this to a Moderator
 20-Oct-2008 10:12
User is offline View Users Profile Print this message


Paul Howstan

Posts: 47
Joined: 27-Sep-2006

Hi,

I think you need to add some extra quotes to your string. Try something like:

system "cmd /c rmdir/S \"C:\\Temp\\test for dir\""

This translates to the command line prompt:

cmd /c rmdir/S "C:\Temp\test for dir"

Paul
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.