Announcements
We have a routine that builds a HTML file to send to a user. I do this by writing the text file to a directory and then sending the file via email.
What I want to do is delete the file again at the end of the the process.
Dexterity has Text_FileOpen and Text_FileClose commands to open and close a file, but no command to delete a file. I thought I may be able to use the DOS del command but I can't get that to work either.
Any ideas? The only other thing I can think to do is to write little application in .NET to do the file delete and call that using the "run application" command within SanScript.
*This post is locked for comments
It's always been there -- or less put it this way, as far back as I can remember :-)
Thanks Mariano. That solves my problem. Has this command always been there or only in the more recent versions of Dex?
By the way, you can run a DOS command from Dexterity too:
local string cmdPath = "C:\Windows\SysWOW64\cmd.exe"; local string cmdParams = "/c dir C:\Temp\*.*"; run application cmdPath, cmdParams;
If you want to keep the command shell window open, just use /k instead of /c.
Dexterity also provides the File_Delete() function. Just pass in the full path and name of the file in generic format, for example:
local string filePath = "C:\SomeFolder\SomeFile.txt"; local boolean result; filePath = Path_MakeGeneric(filePath); result = File_Delete(filePath);
André Arnaud de Cal...
294,206
Super User 2025 Season 1
Martin Dráb
232,968
Most Valuable Professional
nmaenpaa
101,158
Moderator