hdfs::native::hdfsOpenFile
[−]
[src]
pub unsafe extern fn hdfsOpenFile(fs: *const hdfsFS, path: *const c_char, flags: c_int, bufferSize: c_int, replication: c_short, blocksize: int32_t) -> *const hdfsFile
Open a hdfs file in given mode.
Params
fs- The configured filesystem handle.file- The file handle.flags- an|ofbits/fcntl.hfile flags - supported flags are O_RDONLY, O_WRONLY (meaning create or overwrite i.e., implies O_TRUNCAT), O_WRONLY|O_APPEND. Other flags are generally ignored other than (O_RDWR || (O_EXCL & O_CREAT)) which returnNULLand set errno equal ENOTSUP.bufferSize- Size of buffer for read/write - pass 0 if you want to use the default configured values.replicationBlock replication - pass 0 if you want to use the default configured values.blocksize- Size of block - pass 0 if you want to use the default configured values.
Return
Returns 0 on success, -1 on error. On error, errno will be set appropriately. If the hdfs file was valid, the memory associated with it will be freed at the end of this call, even if there was an I/O error.