Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete file command

Status
Not open for further replies.

un1k

Technical User
Mar 8, 2004
30
CA
Hi, I would like to make a little program say with a button that when you click, it will delete a file on your computer like on the desktop, I want to know what command to use, and an example please, thanks!!
 
Thanks for replying, only thing is I don't know where to put the location of the file in that command? like suppose its c:\doc.txt

thanks
 
Thanks a lot I appreciate your help and your time my friend.
 
I was wondering, is it possible to search for a file on the computer with the FileIO? Say I want to check if a computer have the specific files? ty!
 
If you try to open a non-existent file with FileIO, it will generate an error code. You can check if the file exists using this function:
--
fileIO = new(xtra "fileIO")
fileIo_OpenFile("c:\nonexistentfile.txt ", 0)
errorCode = fileIO.status()
errorStr = fileIO.error(errorCode)
put errorStr
--
This returns:
-- "Bad file name"

However if you use Buddy API baFileExists function, it's very simple:
--
put baFileExists("c:\nonexistentfile.txt")
-- 0

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top