Skip to content

calling file.position on a closed file crashes the ESP :) #220

Description

@jim80

Needless to say I did not do this deliberately!
However, it would have rather easier to debug my "not quite there" code if I'd got something other than a stack trace and reboot of my esp8266 ;)

Easily reproduced in the file example , thus ...

// writing/reading strings
file = new File(root + "test.txt", true);
file.write("This is a test.\n");
file.write("We can write ", "multiple", " values.\n");
file.write("This is the end of the test.\n");
file.position = 0;
let content = file.read(String);
trace(content);	
file.close();
trace("\n");

//CRASH AND BURN BABY!
trace (file.position)

which makes quite a nice accidental blink script as the built in LED flashes on restart :)

Anyway, just to let you know if this one is not already on your list, cheers!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions