dashboard-nvim icon indicating copy to clipboard operation
dashboard-nvim copied to clipboard

Unknown file open flag 'rs+' on windows

Open iSplasher opened this issue 2 years ago • 2 comments

Describe the bug I'm getting the error Error executing lua callback: ...l/nvim-data/lazy/dashboard-nvim/lua/dashboard/events.lua:27: Unknown file open flag 'rs+' during exit.

To Reproduce Steps to reproduce the behavior:

  1. Open session on windows
  2. Edit some file
  3. Quit nvim
  4. See error

Expected behavior Exiting works without error.

iSplasher avatar Sep 12 '23 01:09 iSplasher

I'm on windows and ran into this error while messing with persistence.nvim and sessions. After some nvim crashed, this error started to appear.

The solution was to navigate to %USERPROFILE%/appdata/local/nvim-data/shada and and delete any main.shada.tmp files. Only main.shada would need to be there.

cybermelons avatar Jan 03 '24 06:01 cybermelons

I'm also on windows and there is no %USERPROFILE%/appdata/local/nvim-data/shada/main.shada.tmp file. I don't think it's related.

This seems to fix it:

file: dashboard-nvim\lua\dashboard\events.lua

25      -- callback hell holy shit but simply than write a async await lib
26      -- also I don't link to add a thirdpart plugin. this is just a small code
27      uv.fs_open(path, 'r+', 384, function(err, fd)
28        assert(not err, "Cannot open «"..path.."»: " .. err)

The comments above imply that asynchronous mode is used, otherwise there would be no need for callbacks. However, the flags rs+ and specifically the s means synchronous as far as I understand. Requesting an open() operation with the sync flag is nonsensical in this context, thus the error message: Unknown file open flag 'rs+'

if it matters, the file it was trying to open was:

C:\Users\boss\AppData\Local\Temp\nvim\dashboard\cache

tox2ik avatar Apr 17 '24 22:04 tox2ik