CC: Tweaked

CC: Tweaked

42M Downloads

file reading behaving weird when running in edit

Walle123 opened this issue ยท 4 comments

commented

Minecraft Version

1.18.x

Version

1.100.10

Details

This bug only appears when the code is run in ingame ide

The following code should read the file and print the content:

file = fs.open("myFile","r")
print(file.readAll())
file.close()

but it does not

To make it print the content of the file i need to add any print statement anywhere before the printing of the file content.
Like this:

file = fs.open("myFile","r")
print("hello world")
print(file.readAll())
file.close()

The first print will actually not be visible on the screen.

commented

A screenshot of a ComputerCraft computer with the code from the OP running.

I'm afraid I can't reproduce this at all. I assume you're not running a custom OS or shell at all?

commented

grafik
So i tested it again. This only occurs on my advanced turtle.

commented

Ahhhhhhhh. Because it the text overflows and pushes everything up! Fantastic, thank you!

commented

Opse. Didn't consider this might happen on pockets and turtles.. I guess this text will need to be shortened.