Are rename() and unlink() asynchronous functions?

后端 未结 4 692
萌比男神i
萌比男神i 2021-01-22 09:37

I have strong reason to believe that both functions rename() and unlink() are asynchronous, which, from my understanding, means that when the functions are called, the code belo

4条回答
  •  一整个雨季
    2021-01-22 10:07

    I suppose they are not asynchronous, because they return a result telling if the operation was successful or not.

    I believe the problem happens because when you run scandir after making the modifications, it may be using "cached" data, from memory, instead of re-scanning the file system.

提交回复
热议问题