A settimes command for smbclient

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

A settimes command for smbclient

Samba - samba-technical mailing list
Hi folks,

In order to write some nice unit tests for things I would like a
settimes command in smbclient.

The difficulty seems to be that there is no cli_sfileinfo API
available and I imagine that while I could use smb_raw_setpathinfo
from source4 but that might cause linking issues.

Has anyone written anything like this before?

--
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)

Reply | Threaded
Open this post in threaded view
|

Re: A settimes command for smbclient

Samba - samba-technical mailing list
On Tuesday, 12 September 2017 18:38:29 CEST Richard Sharpe via samba-technical
wrote:
> Hi folks,

Hi Richard,
 
> In order to write some nice unit tests for things I would like a
> settimes command in smbclient.
>
> The difficulty seems to be that there is no cli_sfileinfo API
> available and I imagine that while I could use smb_raw_setpathinfo
> from source4 but that might cause linking issues.
>
> Has anyone written anything like this before?

libsmbclient has smbc_utimes which calls cli_setpathinfo_basic() to set
create_time, access_time, write_time and change_time. It falls back to
cli_setatrE() and cli_setatr().

Look into SMBC_setatr() in source3/libsmb/libsmb_file.c

If there is no such function in smblclient yet you should call it utimes.

Hope that helps,



        Andreas


--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org