Skip to content

Commit

Permalink
fix(filesystem): use correct flags and permissions when creating file (
Browse files Browse the repository at this point in the history
  • Loading branch information
cseickel committed Oct 24, 2023
1 parent b2da1f5 commit 1236db9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lua/neo-tree/sources/filesystem/lib/fs_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ M.create_node = function(in_directory, callback, using_root_directory)
local open_mode = loop.constants.O_CREAT
+ loop.constants.O_WRONLY
+ loop.constants.O_TRUNC
local fd = loop.fs_open(destination, "w", open_mode)
local fd = loop.fs_open(destination, open_mode, 420)
if not fd then
if not loop.fs_stat(destination) then
api.nvim_err_writeln("Could not create file " .. destination)
Expand All @@ -402,7 +402,6 @@ M.create_node = function(in_directory, callback, using_root_directory)
log.warn("Failed to complete file creation of " .. destination)
end
else
loop.fs_chmod(destination, 420)
loop.fs_close(fd)
end
end
Expand Down

0 comments on commit 1236db9

Please sign in to comment.