目录

Should I call fileIo.closeSync in ArkTS after close() in C is called to close the FD obtained by fileIo.openSync?

Yes. After the FD (returned by fileIo.openSync()) passed from ArkTS to C is no longer required, you need to use close() to close the FD in C and use fileIo.openSync() to close the file in ArkTS. Since files passed across language boundaries require resource management from both sides, it is recommended to set the null value after closing the file to avoid repeated operations.