Search code examples
linuxsambalazarus

How to detect samba locked files programmatically?


How can I get a list of files locked by samba programmatically?

There is a command smbstatus which will give you that information. But I want to get that info within my program (written in Lazarus). One method is to run smbstatus as a child process and parse the output. I am trying to directly get the required info within the program (using an API).


Solution

  • Parsing the smbstatus output is a fairly sensible thing to do.

    You might also be able to access some of this information using libsmbsharemodes, which is a part of Samba.