7 #include <libsmbclient.h>
8 #include "get_auth_data_fn.h"
11 int main(int argc
, char * argv
[])
26 smbc_init(get_auth_data_fn
, debug
);
28 printf("CAUTION: This program will overwrite a file. "
29 "Press ENTER to continue.");
30 fgets(buffer
, sizeof(buffer
), stdin
);
35 fprintf(stdout
, "\nPath: ");
37 fgets(path
, sizeof(path
) - 1, stdin
);
38 if (strlen(path
) == 0)
43 p
= path
+ strlen(path
) - 1;
49 if ((fd
= smbc_open(path
, O_WRONLY
| O_CREAT
| O_TRUNC
, 0)) < 0)
55 strcpy(buffer
, "Hello world\n");
57 ret
= smbc_write(fd
, buffer
, strlen(buffer
));