Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How Do You Delete A Folder?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Fiend-Master




PostPosted: Sun Jan 16, 2005 1:12 am   Post subject: How Do You Delete A Folder?

Ok, I got my program to delete a file of my choice on any given location on my computer, assuming of course i enter the correct pathname. When i tried to use the same code to delete a folder, I got an error msg "Access (permission) denied"

% The "File.Delete" program.
const pathName : string := "C:\\WINDOWS\\Desktop\\Test"

% Create file
var f : int
var line : string
open : f, pathName, put
put : f, "There is a line here"
close : f
put pathName, " created"

% Delete the file
File.Delete (pathName)
if Error.Last = eNoError then
put skip, pathName, " deleted"
else
put skip, "Did not delete ", pathName
put "Error: ", Error.LastMsg
end if

Thats the code I used (the code is an altered version of the example in the help section) (its supposed to delete a folder named "Test" on my desktop). Is there any hope? Thanks in advance.
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sun Jan 16, 2005 9:58 am   Post subject: (No subject)

1)
Use [code] or [syntax] tags.

2)
Press F10.

3)
Search for Dir. commands.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: