memScoped { val path = /tmp/memscoped_example.txt val content = Hello from Kotlin/Native! val fd = open(path, O_WRONLY or O_CREAT or O_TRUNC, (S_IRUSR or S_IWUSR).toUInt()) if (fd < 0) { perror(open) return } val cContent = content.cstr.getPointer(this) val written = write(fd, cContent, content.length.toULong()) if (written < 0) { // ޙུ ྫ͑ ,PUMJOͷ 4USJOHΛ $ʹ ͦͷ··ͤͳ͍ $ͱΓऔΓ͢ΔࡍʹҰ࣌తͳωΠςΟϒ ϝϞϦྖҬΛ֬อ͍ͨ͠ͱ͖ʹ͏ ͜ͷϒϩοΫΛൈ͚ͨ࣌Ͱɺ֬อͨ͠ ϝϞϦղ์͞ΕΔ