Skip to content
Discussion options

You must be logged in to vote

it's reachable from any plugin (fs.trash is just a field on fs), but heads up it's only on main/nightly right now and isn't documented, so it could still change.

ent there is a TrashEntry userdata. you don't build it yourself, you get one from fs.trash.list() or fs.trash.entry{ top = ..., rel = ... }. it has key, top, rel, name, original (where it came from), stat, etc. restore takes a list of them:

local ents, err = fs.trash.list() -- top level of the trash
for _, ent in ipairs(ents or {}) do
  if ent.original and tostring(ent.original) == "/home/me/notes.txt" then
    local ok, err = fs.trash.restore { ent }
  end
end

(these are async, so call them from an async plugin context, not a sy…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@drewlwhitney
Comment options

@hippi345
Comment options

@drewlwhitney
Comment options

Answer selected by drewlwhitney
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
1. Q&A
Labels
None yet
3 participants