I am trying to create and overwrite a file in file system. The below code working with local filesystem and NFS as well.
But not working with HDFS NFS gateway.
open_file = open("/hdfs_nfs/hdfs_Data/sampledata/testWrite.txt", 'wb+')
open_file.write("This is just a sample data")
open_file.close()
The file "testWrite.txt" is getting created on HDFS mount point when i run above code for first time. But it is not working when I run the code from 2nd time onwards, with or with out changing the content.
I am getting below error.
IOError: [Errno 22] invalid mode ('wb+') or filename: '/hdfs_nfs/hdfs_Data/sampledata/testWrite.txt'