WebDav plugin to show file locks
Moderators: Hacker, petermad, Stefan2, white
WebDav plugin to show file locks
Is it possible to enhance the plug-in to show active file locks?
Perhaps this could be added to the Properties dialog for the file (Version information).
With TC I can't see if a file is locked, whereas bitkinex will show the active locks on the file.
Cheers!
Perhaps this could be added to the Properties dialog for the file (Version information).
With TC I can't see if a file is locked, whereas bitkinex will show the active locks on the file.
Cheers!
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Currently my plugin doesn't support its own properties dialog, but it would certainly be a good idea to add it. Do you have any ideas how the lock is reported? I looked in the DAV*.tmp file in the TEMP directory and found something like this (GMX):
How does it look for you when the file is locked?
Code: Select all
<D:supportedlock>
<D:lockentry>
<D:lockscope><D:exclusive/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
<D:lockentry>
<D:lockscope><D:shared/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
</D:supportedlock>
<D:lockdiscovery/>
<D:resourcetype/>
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Thanks for the attention! 
Here is what I see:
What bitkinex displays under Active Lock(s) is the <D:locktoken>:
Lock identifier: opaquelocktoken:4d72a1a6-55ab-4301-a718-527772ed42f3:cgrenier
So it seems that you get all the info necessary to find the lock.

Here is what I see:
Code: Select all
<D:response>
<D:href>/ushare/webdav/****/Global_FrontEnd_2011.xlsm</D:href>
<D:propstat>
<D:prop>
<D:lockdiscovery>
<D:activelock>
<D:locktype>
<D:write/></D:locktype>
<D:lockscope>
<D:exclusive/></D:lockscope>
<D:depth>0</D:depth>
<D:owner>cgrenier</D:owner>
<D:timeout>Infinite</D:timeout>
<D:locktoken>
<D:href>opaquelocktoken:4d72a1a6-55ab-4301-a718-527772ed42f3:cgrenier</D:href>
</D:locktoken>
</D:activelock>
</D:lockdiscovery>
<D:supportedlock>
<D:lockscope>
<D:exclusive/></D:lockscope>
<D:locktype>
<D:write/></D:locktype>
</D:supportedlock>
<D:resourcetype></D:resourcetype>
<D:displayname>Global_FrontEnd_2011.xlsm</D:displayname>
<D:source/>
<D:creationdate>2011-01-19T17:27:41Z</D:creationdate>
<D:getlastmodified>Tue, 22 Feb 2011 07:15:19 GMT</D:getlastmodified>
<D:getcontentlanguage></D:getcontentlanguage>
<D:getcontenttype>application/octet-stream</D:getcontenttype>
<D:getetag>4d72a1a6-55ab-4301-a718-527772ed42f3_1298358919607</D:getetag>
<D:getcontentlength>283490</D:getcontentlength>
<D:authticket>TICKET_1d19027248ed4d36906d9919b3d45cae8aa66a25</D:authticket>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
Lock identifier: opaquelocktoken:4d72a1a6-55ab-4301-a718-527772ed42f3:cgrenier
So it seems that you get all the info necessary to find the lock.

- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Thanks for the info! If I understand you correctly, the file is locked when there is an entry "locktoken", is this correct? How does a file entry look when it isn't locked?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
In fact, when there are no locks, this whole section will disappear:
So I would say it is the <D:activelock> element that represents the lock, while the locktoken is just one information about the lock.
You can see other info such as locktype, lockscope and owner as well.
It seems you can have multiple locks on a file (although I guess they shouldn't be "exclusive" in that case, as the above one), but I'm not sure our UShare client supports that - I didn't have much time to play with that. Bitkinex, as well, can just create this kind of lock.
In TC we have no visual clue about this lock, it just looks the same - until the write operation fails on it.
Bitkinex displays a STOP mark overlay on the file icon and one can check the active locks in the properties dialog.
Code: Select all
<D:lockdiscovery>
<D:activelock>
<D:locktype>
<D:write/></D:locktype>
<D:lockscope>
<D:exclusive/></D:lockscope>
<D:depth>0</D:depth>
<D:owner>cgrenier</D:owner>
<D:timeout>Infinite</D:timeout>
<D:locktoken>
<D:href>opaquelocktoken:4d72a1a6-55ab-4301-a718-527772ed42f3:cgrenier</D:href>
</D:locktoken>
</D:activelock>
</D:lockdiscovery>
You can see other info such as locktype, lockscope and owner as well.
It seems you can have multiple locks on a file (although I guess they shouldn't be "exclusive" in that case, as the above one), but I'm not sure our UShare client supports that - I didn't have much time to play with that. Bitkinex, as well, can just create this kind of lock.
In TC we have no visual clue about this lock, it just looks the same - until the write operation fails on it.

Bitkinex displays a STOP mark overlay on the file icon and one can check the active locks in the properties dialog.
Actually, if I think a bit, I would say that this section:It seems you can have multiple locks on a file (although I guess they shouldn't be "exclusive" in that case, as the above one), but I'm not sure our UShare client supports that - I didn't have much time to play with that. Bitkinex, as well, can just create this kind of lock.
Code: Select all
<D:supportedlock>
<D:lockscope>
<D:exclusive/></D:lockscope>
<D:locktype>
<D:write/></D:locktype>
</D:supportedlock>
So in my case this is the only type of lock - exclusive-write lock - that is supported.
Which might explain why I'm able to create only this kind of lock.

Am I right?
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes, sounds reasonable. I will try to add an about box with the locking information.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
You can get a first beta version here:
https://plugins.ghisler.com/beta/webdav_21_beta1.zip
Sources:
https://plugins.ghisler.com/beta/webdav_src21_beta1.zip
What was changed:
1. Properties dialog (Alt+Enter)
2. Support for local long file names up to 1022 characters (remote not checked yet)
3. Encode # sign - but doesn't work with all servers (Ubuntu: Yes, GMX: No)
Please let me know whether it works for you or not!
https://plugins.ghisler.com/beta/webdav_21_beta1.zip
Sources:
https://plugins.ghisler.com/beta/webdav_src21_beta1.zip
What was changed:
1. Properties dialog (Alt+Enter)
2. Support for local long file names up to 1022 characters (remote not checked yet)
3. Encode # sign - but doesn't work with all servers (Ubuntu: Yes, GMX: No)
Please let me know whether it works for you or not!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Indeed there are currently no localization functions used to handle things like thousands separators, sorry.1 observation: the size in the dialog is missing thousand separator - shows 377750 b (368 k).
That's a good idea, I have simply set the "read only" attribute for locked files. Please try it!1 request: would it be possible to show the lock in the "Attr" column? Perhaps as "r---"?
You can get a second beta version here:
https://plugins.ghisler.com/beta/webdav_21_beta2.zip
Sources:
https://plugins.ghisler.com/beta/webdav_src21_beta2.zip
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Thanks, I have put it on the official plugins page now!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com