![]() |
File Deletion
How can I delete a file on RC with a script? The only alternative that I could find was:
NPC Code:requestfiledeletion( "filepath/filename" ) But like Skyld said when I asked him; thats a function with the scripted Client RC. Whatever, but can anyone tell me how its done? |
deletefile("path/to/file")
|
Didnt work.
|
Has to be serverside.
|
Quote:
Heres what I tried (file and location are not the same for *security* reasons or whatever): NPC Code: |
Then something is wrong thats beyond what we can see here.
NPC Code: ¹ Script Functions: NPC-Server |
I sent a message to Stefan, hopefully he´ll look into it and/or tell us whats wrong.
|
I have used this before, and I just tested it on my NPC-Server and it works.
Perhaps something was done to my NPC-Server? I doubt it would be just mine though.. so maybe Stefan can help. |
Odd. Maybe something with the folder options? Doubt it though since its able to read info from the text files.
|
Ok, lets show a more detailed explanation on what im trying to do then. First, the script!
Note: not the actuall script, but I tried this and the file wont get deleted. NPC Code: Then, lets /find the file on RC! PHP Code:
Ok, next step: lets add the NPC to myself and check if it gets deleted! PHP Code:
Ah, now the file should be deleted, right? But.. its still in the folders! Lets check with /find.. PHP Code:
So, does anyone have a clue what im doing wrong if anything? |
Only thing I can think of, is that you can't delete files in the levels folder.
I delete files regularly from my manadb/items/*.arc folder and it works fine. -performs a deletion- See! |
Ok, so I added myself rights for a new folder!
PHP Code:
So if im wrong, and you can add other folders there, please tell me how to do.. if not, am I screwed when it comes to deleting a file? |
The file doesn't have to be in the folder config for you to be able to use loadlines and such. Just specify the entire path to it.
|
Ok, I got it to work when I moved the files to a folder thats not a sub-folder to levels/.
|
Quote:
Yeah, just like I thought. :) You use deletelevel() to delete things in the levels folder.. at least you can delete levels that way. |
I know. I tried using deletelevel() on other files aswell, didnt work though.
|
deletefile() is not allowed to delete files in the levels folder, for security reasons, since there is no system for script rights yet. deletelevel() can be used for deleting level files (.nw, .graal).
|
Couldn't we rename another type of file to a .nw or .graal using a script, then delete it?
|
Quote:
Quote:
|
| All times are GMT +2. The time now is 08:18 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.