How to remove some files when I quit Theia application?


I create some pipe files using the named-pipes module in my Theia application.
How to delete these pipe files when I quit Theia via command+q (on MacOS) or ctrl + c?
Since the delete of pipes need to be an async function, so the onStop lifecycle of BackendApplicationContribution maybe is not suitable.

Hi @inlann,

I don’t really think there’s currently an async callback for quitting Theia. If these pipes are file based, you can probably use the sync file system to delete them. Using fs.unlinkSync allows for synchronous file removal.

1 Like

Really appreciate :smile: