Closed bishnu1184 closed 1 year ago
nfs_open* with the flag O_TRUNC should do that. That will truncate the file when you open it.
Thanks, it worked. I was trying to pass O_TRUNC in nfs_create so that if the file doesn't exist then it will create that and if it exist then it should truncate the existing file. But I was always getting error EEXIST for existing file. So I think I will have to add error code check and based on that I will have to call nfs_create or nfs_open* APIs.
Hi Ronnie, I want to overwrite an existing file on NFS share with new file, so that content of the file gets updated but all its permission and ACLs will remain same as of original file. Hence I wanted to know if there is any API or way in libNFS by which I can do the same.
Thanks, Bishnu