python-irodsclient
python-irodsclient copied to clipboard
Force flag not required for data_object.put( )
Running the following script
#!/usr/bin/python
# put.py
from __future__ import print_function
import sys
from irods.test.helpers import make_session
import irods.keywords as kw
if len(sys.argv[1:3])==2:
s = make_session()
c = s.data_objects.put (
sys.argv[1],
sys.argv[2],)
in this manner:
$ touch file
$ for x in 1 2 ; do echo try $x >> file ; python put.py file `ipwd`/file ; done
should succeed on try 1 and fail on try 2 , because iRODS client/server convention requires a FORCE_FLAG_KW for overwrites. However, both tries succeed; and, moreover, looking at the contents of the 'file' data object :
$ iget file -
try 1
try 2
shows the data object was written a second time without the force flag.
Presumably this is due to the open/write/close nature of the Python put() operation...
So, there are no warnings/errors... has this always been the case?
Not even a warning, no ... and it's true back a couple of releases, ie 0.8.6
alternate / later / duplicate discussion found at https://github.com/irods/python-irodsclient/issues/322