Skip to content

Commit e14055a

Browse files
committed
Add get_handle
Could be useful to do POSIX operations on the same file without reopening it.
1 parent 79d4f59 commit e14055a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cufile/cufile.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,12 @@ def write(self, src: ctypes.c_void_p, size: int, file_offset: int = 0, dev_offse
7474
"""
7575
Write to the file.
7676
"""
77-
return cuFileWrite(self._cu_file_handle, src, size, file_offset, dev_offset)
77+
return cuFileWrite(self._cu_file_handle, src, size, file_offset, dev_offset)
78+
79+
def get_handle(self):
80+
"""
81+
Get the file handle.
82+
"""
83+
return self._handle
84+
85+

0 commit comments

Comments
 (0)