Skip to content

FileIO size() return an incorrect value (Arduino 1.5.7) #2203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
guiyanakuang opened this issue Jul 22, 2014 · 1 comment
Closed

FileIO size() return an incorrect value (Arduino 1.5.7) #2203

guiyanakuang opened this issue Jul 22, 2014 · 1 comment

Comments

@guiyanakuang
Copy link

Originally File.size() returns an unsigned long value, but the file size is larger than 32768, it will return an incorrect value.

#include <FileIO.h>
#include <Bridge.h>

void setup() {
  Bridge.begin();
  Serial.begin(9600);
  FileSystem.begin();
  while(!Serial); 
  File dataFile = FileSystem.open("/bin/busybox", FILE_READ);
  unsigned long len= dataFile.size();
  Serial.println(len);//return 26544
}

PuTTY
root@Arduino:/bin# ls busybox -l
-rwxr-xr-x 1 root root 419760 Apr 10 09:11 busybox

@guiyanakuang guiyanakuang changed the title FileIO size() return an incorrect value FileIO size() return an incorrect value (Arduino 1.5.7) Jul 22, 2014
cmaglie added a commit that referenced this issue Jul 24, 2014
@cmaglie
Copy link
Member

cmaglie commented Jul 24, 2014

Thank you for the bug report.

The function is fixed here: 8131af9
and will be released with IDE 1.5.8

C

@cmaglie cmaglie closed this as completed Jul 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants