zap_resource(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

✨ zap_resource πŸ’…

okay so bestie, welcome to zap_resource(3) β€” that's the Arcan Lua API page, and yes we're about to learn how to unlink a file in the appl-temp path or in a writable user namespace. it's giving "delete but make it licensed" πŸŽ€


🌸 NAME 🌸

zap_resource β€” unlink a file in the appl-temp path or writable user namespace. literally that's the whole gig, and she does it well πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

bool:success, boolres
zap_resource( string:res )
zap_resource( string:res, string:namespace )

two flavours, same icon energy ✨


πŸ‘‘ DESCRIPTION πŸ‘‘

so this function can be used to delete a file πŸ—‘οΈ periodt.

by default, this applies only to the appl-temp namespace. that's the default, no cap.

if namespace is provided and it matches a user-defined writable namespace ID (peep list_namespaces for that one πŸ”), then the deletion applies to a file in that namespace instead. main character behaviour only πŸ’…

and it returns whether the file was successfully deleted or not β€” so like, you get a yes-or-no back, check it, don't just vibe and hope 🫢


🧚 EXAMPLE 🧚

here's the cute lil demo, copied exactly because we do not mess with code in this house:

function zap_resource0()
      open_rawresource("test.out");
      zap_resource("test.out");
      if (resource("test.out")) then
            warning("something went horribly wrong.");
      end
end

so we open test.out, we zap test.out, then we check with resource("test.out") and scream into the void if it's still there. iconic quality assurance ngl 😭


πŸ’€ MISUSE πŸ’€

okay babes, buckle up, because these two are the what-not-to-do section and they are NOT a vibe.

function zap_resource0()
      zap_resource("/../../../../../../usr/bin/arcan");
end
function zap_resource1()
      zap_resource("/../resources/scripts/mouse.lua");
end
bestie. do not do this. path traversal attempts like these are right there in the manual as MISUSE for a reason πŸ™ˆ like, the manpage literally filed them under "misuse" and went home.

🌈 SEE ALSO 🌈

okay so this page lives alongside resource β€” that's the name at the bottom of the original footer, and that's your reference breadcrumb πŸ“


and that's the whole page, bestie!! this one came from the Arcan Lua API, source line resource, dated October 2026, and the page is zap_resource(3) in case you need to cite it in your group chat. go forth and delete responsibly πŸ’œπŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ”₯πŸ‘‘β­πŸŒˆπŸ’€πŸ™ˆπŸ“πŸ§š

πŸ“¦ where this page comes from