Folder and file permission columns #53
Replies: 3 comments
-
What about gfileinfo? Maybe something like -- filepermissionswdx.lua (Linux)
-- 2025.07.06
--[[
Returns file permissions.
Details: https://github.com/j2969719/doublecmd-plugins/discussions/53
]]
local fields = {"Owner", "Group", "Other"}
function ContentGetSupportedField(FieldIndex)
if fields[FieldIndex + 1] ~= nil then
return fields[FieldIndex + 1], "Read|Write|Execute", 6
end
return "", "", 0
end
function ContentGetDefaultSortOrder(FieldIndex)
return 1; --or -1
end
function ContentGetDetectString()
return 'EXT="*"'
end
function ContentGetValue(FileName, FieldIndex, UnitIndex, flags)
if FieldIndex > 2 then return nil end
local sA = SysUtils.GetFileProperty(FileName, 1)
if sA == nil then return nil end
local i = FieldIndex * 3 + UnitIndex + 2
local t = string.sub(sA, i, i)
if t == "" then
return nil
elseif t == "-" then
return false
else
return true
end
end ? |
Beta Was this translation helpful? Give feedback.
-
https://github.com/j2969719/doublecmd-plugins/tree/master/plugins/wdx/simplefileinfo also has string and boolean fields for permissions from the current user perspective, not from owner/group/others buuut the thing with wdx is that they will always be slower than dc's built-in fields (especially noticeable when scrolling) and will only work with the local file system. |
Beta Was this translation helpful? Give feedback.
-
@Skif-off Skif-off j2969719 Thanks again |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Linux / Debian based
I have seen that there are some permission/attribute based plugins available.
I was wondering if anyone would consider making something like the following.
Not sure if something like this could be achieved using only Lua without need for 3rd party application? but either way.
Suggesting to create a WDX plugin that would provide columns for folder and file permissions.
This plugin would contain 10 columns (or more if anyone has any other ideas to add to this suggestion?)
-The first column I will mention probably is not really needed because it is already offered by DC, called
Attributes
, which shows the "text" value of permissions.If this is easy to achieve, I say to add this just because it would make this plugin capable of handling all permission columns within the same plugin, but again not important if difficult/do not agree.
-In Linux I know what the "text" values mean but to be honest when viewing them I just see letters. Suggesting to offer columns for single permission values (as seen in check box grid in
cm_SetFileProperties
command dialog), so the other 9 columns would be the following (one for each)I do not like because it is the opposite of how the dialog check box grid looks, but I think my following suggestion will work better in column view to be the opposite.
So each of these columns would get a value On/Off.
Because permissions being
On
is more common, I would sayOn
=blank no value
Off
=x
orX
orOff
This would make the
Off
values stand out to user.Again it is the opposite of the grid that uses "check" for
On
so hopefully in actual use this is not too confusing for the user? Would have to test this out to verify.If this does make sense, then this could be the default, but if not the good thing is that these on/off text values could be changed in the Lua / cpp file.
If anyone is interested in this, please let me know.
Also again, if anyone has any other suggestions that could be added to this, please mention them.
Thank You
Beta Was this translation helpful? Give feedback.
All reactions