@@ -424,6 +424,7 @@ def open(self, path, mode,
424
424
returned_values = None , # Used to update session reference, for forging more conns to same host, in irods.parallel.io_main
425
425
allow_redirect = True , # This may be set to False to disallow the client redirect-to-resource.
426
426
** options ):
427
+ _buffering = options .pop ('_buffering' , - 1 )
427
428
_raw_fd_holder = options .get ('_raw_fd_holder' ,[])
428
429
# If no keywords are used that would influence the server as to the choice of a storage resource,
429
430
# then use the default resource in the client configuration.
@@ -526,12 +527,19 @@ def make_FileOpenRequest(**extra_opts):
526
527
# Use case: auto_close has defaulted to the irods.configuration getter.
527
528
# access entry in irods.configuration
528
529
auto_close = auto_close ()
530
+
531
+ bufopt = {}
532
+ if _buffering >= 0 : # originally '>' - DWM
533
+ bufopt ['buffer_size' ] = _buffering
534
+
529
535
if auto_close :
530
- ret_value = ManagedBufferedRandom (raw , _session = self .sess )
536
+ ret_value = ManagedBufferedRandom (raw , _session = self .sess , ** bufopt )
531
537
else :
532
- ret_value = io .BufferedRandom (raw )
538
+ ret_value = io .BufferedRandom (raw , ** bufopt )
539
+
533
540
if 'a' in mode :
534
541
ret_value .seek (0 ,io .SEEK_END )
542
+
535
543
return ret_value
536
544
537
545
def replica_truncate (self , path , desired_size , ** options ):
0 commit comments