Trouble understanding how to process C string

后端 未结 4 1380
粉色の甜心
粉色の甜心 2021-01-27 07:13

I\'m trying to use Mac OS X\'s listxattr C function and turn it into something useful in Python. The man page tells me that the function returns a string buffer, which is a \"si

4条回答
  •  花落未央
    2021-01-27 07:46

    It looks like listxattr returns the size of the buffer it has filled, so you can use that to help you. Here's an idea:

    for(int i=0; i

    Now, instead of being separated by null characters, the attributes are separated by commas.

提交回复
热议问题