opendal icon indicating copy to clipboard operation
opendal copied to clipboard

Tracking issue of missing functionalities in OpenDAL C binding

Open xyjixyjixyji opened this issue 2 years ago • 9 comments

Currently the C binding supports...

  • [x] write
  • [x] read
  • [x] delete
  • [x] stat
  • [x] is_exist
  • [x] list

The missing functionalities are.... (welcome to add up)

  • [ ] async support
  • [x] check()
  • [x] copy()
  • [x] rename()
  • [ ] remove() (remove_all(), remove_via())
  • [x] reader()
  • [x] writer()
  • [ ] Future APIs (append (through write_with(...).append(...)), etc.)
    • This may need some discussions on the implementations since the C does not have such concepts as Future.
  • [ ] presign APIs (I think this could be considered later)

xyjixyjixyji avatar Aug 28 '23 15:08 xyjixyjixyji

I'm thinking about adding reader and writer so users can control the underlying data operations. I'm not sure if it's much better to have an opendal-cpp instead.

Xuanwo avatar Aug 28 '23 15:08 Xuanwo

I'm thinking about adding reader and writer so users can control the underlying data operations. I'm not sure if it's much better to have an opendal-cpp instead.

We could have an opendal cpp binding, but cbindgen generates reletively the same library and header files. Hence the implementation is roughly the same.

I mean its possible that the opendal cpp binding need to share the underlying impl of the C binding but it could wrap it in a better way obviously.

xyjixyjixyji avatar Aug 28 '23 15:08 xyjixyjixyji

We could have an opendal cpp binding, but cbindgen generates reletively the same library and header files. Hence the implementation is roughly the same.

I'm thinking about cxx instead. The biggest benefit is that we can use existing types in std, for example std::string and std::vector.

Xuanwo avatar Aug 28 '23 15:08 Xuanwo

  • Future APIs (append(), etc.)

Please note that append has been removed: it's now op.write_with("path", bs).append(true).await

Xuanwo avatar Aug 28 '23 16:08 Xuanwo

We could have an opendal cpp binding, but cbindgen generates reletively the same library and header files. Hence the implementation is roughly the same.

I'm thinking about cxx instead. The biggest benefit is that we can use existing types in std, for example std::string and std::vector.

Definitely, it would be way better to develop on std containers!

xyjixyjixyji avatar Aug 28 '23 16:08 xyjixyjixyji

Can c binding add async support? Only having blocking API, concurrency performance will be a problem.

jiaoew1991 avatar Sep 19 '23 03:09 jiaoew1991

Can c binding add async support? Only having blocking API, concurrency performance will be a problem.

I would say it is 100% possible to implement this since hyper already does this. But it might take me a while to design and implement this since it is relatively complex in C.

xyjixyjixyji avatar Sep 19 '23 03:09 xyjixyjixyji

If supporting async in C bindings is difficult, it would be better to directly provide an async API for C++ bindings. 😄

jiaoew1991 avatar Sep 19 '23 03:09 jiaoew1991

  • [ ] async support

  • [x] check() https://github.com/apache/opendal/pull/5851

  • [x] copy() https://github.com/apache/opendal/pull/3517

  • [x] rename() https://github.com/apache/opendal/pull/3517

  • [ ] remove() (remove_all(), remove_via()) https://github.com/apache/opendal/pull/5851#issuecomment-2745379005

  • [x] reader() https://github.com/apache/opendal/pull/3259

  • [x] writer() https://github.com/apache/opendal/pull/5141

asukaminato0721 avatar Mar 22 '25 16:03 asukaminato0721