{"id":"runtime--File.TryReadBytes","name":"File.TryReadBytes","owner":"yeho","package":"runtime.File","kind":"builtin","signature":"File.TryReadBytes(text path, int maximum_bytes, list of byte destination) -> int","description":"Try read bytes through the File runtime.","context":"Built into Yeho; no package import is needed. Native services require an admitted host and the correct resource lifecycle.","parameters":[{"name":"path","type":"text","description":"Supply path as text.","rule":"Text"},{"name":"maximum_bytes","type":"int","description":"Supply maximum bytes as int.","rule":"Int"},{"name":"destination","type":"list of byte","description":"Supply destination as list of byte.","rule":"MutableByteList"}],"returns":"int","members":[],"tags":["builtin","cpu","file","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"src/compiler/common/intrinsic_registry.cpp","line":807,"sha256":"14d29529d2d3c0e2b587f83c7f125b99ada142ed7ae28612701ea6cb9174ac65"},"status":"registered-intrinsic","notes":["The example checks the call shape. Opening windows, recording audio, changing files, network operations, and process operations have real effects when run. Follow the corresponding package lifecycle before using live resources."],"examples":[{"id":"usage","title":"Call File.TryReadBytes","description":"A complete typed caller with illustrative arguments. Native operations need the corresponding host and resources.","code":"text path = \"path\"\nint maximum_bytes = 4\nlist of byte destination = []\nint result = File.TryReadBytes(path, maximum_bytes, destination)\nConsole.Log(Text.From(result))\n","manifest":"manifestVersion = \"2\"\npackage = \"api.example.runtime__file_tryreadbytes\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n","tags":["cpu","builtin"],"run":"cpu-oracle","verification":"type checked","sha256":"40c9f46987fbbba65215b1cb810e3d81b57274d418600dab350990b82e6bd0dc","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=runtime--File.TryReadBytes","json":"https://demonhunterlabs.com/reference/items/runtime--File.TryReadBytes.json","markdown":"https://demonhunterlabs.com/reference/text/runtime--File.TryReadBytes.md"}
