New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time to deprecate lfs.rmdir? #4
Comments
|
Calling os.remove on directories does not work on all platforms. It fails for me on Windows 7 with "Permission denied", for example, where lfs.rmdir works fine, so I think it should stay as it is. |
|
I agree with you, but in that case it's worth documenting, perhaps in more general terms, something like "Although lfs.rmdir is logically the same as os.remove applied to an empty directory, lfs.rmdir is known to work in situations in which os.remove does not." |
|
Actually os.remove just calls the underlying system remove. For POSIX remove is unlink for files and rmdir for directories, but for Windows the behavior is different: http://msdn.microsoft.com/en-us/library/2da4hk1d(v=VS.100).aspx. I guess the problem is with the documentation of os.remove. :-) |
|
Agreed. |
os.remove() fails on empty directories in non-POSIX systems. lunarmodules/luafilesystem#4 lfs.rmdir() "usually" works, so use it instead. Closes neovim#5236
os.remove() fails on empty directories in non-POSIX systems. lunarmodules/luafilesystem#4 lfs.rmdir() "usually" works, so use it instead. Closes neovim#5236
os.remove() fails on empty directories in non-POSIX systems. lunarmodules/luafilesystem#4 lfs.rmdir() "usually" works, so use it instead. Closes neovim#5236
(In favour of os.remove, which since 5.0 has acquired the ability to remove empty directories too; it would even be possible to do
lfs.rmdir = os.remove
Given that os.remove removes both files and directories, it seems pointless to keep a function that removes only directories, especially when there is no function which removes only files, either in core Lua or LFS.)
The text was updated successfully, but these errors were encountered: