Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 29 JUN 2000 10:44:47PM David Singer wrote:

Well, I've been reading up, searching, and have learned a lot about copying files, launching DOS apps, etc. But I've not found specific information on deleting a dos file while in an OI application.

There seems to be a RENAMEFILE, but no DELETEFILE in Utility.

When I try RTRN=UTILITY("RUNWIN","DEL C:\JUNK.TXT")

I get an error message in the service (which breaks to the debugger), no file deletion.

When I try RTRN=UTILITY("RUNWIN","C:\UTIL\PFM.COM")

I get an error message in the service (which breaks to the debugger), but the DOS utility PFM.COM is actually running when I kill the debugger.

Something is sorta working…

Oh, I'm on NT, if that makes any difference.

David Singer


At 29 JUN 2000 11:34PM Donald Bakke wrote:

David,

Just use the OSDelete command.

dbakke@srpcs.com

SRP Computer Solutions


At 30 JUN 2000 03:47AM Oystein Reigem wrote:

David,

I can get RUNWIN to del c:\junk.txt on my NT computer. Could there be something wrong with the file? Or the file name? Or some app got it open?? E.g your own OI app wrote and OSClose'd the file but did not Flush???

About problems NT and RUNWIN: . (And about problems with (human) memory too…) :-)

- Oystein -


At 30 JUN 2000 09:41AM Don Miller - C3 Inc. wrote:

Just be sure to check STATUS() after OSDELETE. If you're having troubles with UTILITY call to do this it might be the case that you've got the file open (or someone else has..) or you've closed it but haven't flushed the handles.

Don Miller

C3 Inc.


At 30 JUN 2000 10:28AM David Singer wrote:

Oystein-

Thanks, I did discover that posting by following an earlier posting of yours. Fooling around, I found that the proper syntax is:

COMMAND.TO.USE=CMD /C DEL C:\JUNK\JUNK.TXT"

rtrn=Utility("RUNWIN",COMMAND.TO.USE)

The value of using this format is that I can get beyond the 8-char naming convention for files which is (apparently) otherwise inherent in 16-bit OI.

The "/c" means to exit the command shell back to OI, whereas "/k" would be to leave the command shell up for a manual exit.

Now I have to figure out how to grab the DOS result of failed DOS functions so I can test appropriately in the OI application. I think that info is proximate to the path you suggested.

David


At 30 JUN 2000 10:43AM David Singer wrote:

More on determining if the DOS command failed or worked:

Let's say the DOS command was issued through Utility().

rtrn=Utility("RUNWIN","cmd /c XCOPY C:\JUNK\*.* D:\JUNK\*.* /S/V/E")

If c:\Junk\ does not exist, the command will fail in the intent, but Utility will return with a TRUE statement because the command "executed". I'm going to explore the recommended use of STATUS() to determine if the intent of the command was sucessful or not.

David


At 30 JUN 2000 11:10AM David Singer wrote:

Well, my previous posting was incorrect. Utility("RUNWIN",) does not return TRUE or FALSE, it returns a 4-field string, the first of which is the , the other 3 being handles (or pointers or whatever). This makes testing RTRN from RTRN=Utility() as a did/not did flag inappropriate.

Also, STATUS() seems to stay zero regardless of DOS failure or success.

In the case of XCOPY I'm planning on testing for the existance of the target file(s) after making the Utility() call (unless anybody comes up with a better solution).

David

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/c8caf0005ee6a26e8525690e000f1638.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1