Script API: use plain int32 as file handle