# Examples please for LittleFS

**URL:** <https://forum.arduino.cc/t/examples-please-for-littlefs/1136267>\
**Category:** GIGA R1 WiFi\
**Created:** [June 9, 2023, 3:20pm UTC](https://forum.arduino.cc/t/examples-please-for-littlefs/1136267 "2023-06-09T15:20:07Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![johnsondavies](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@johnsondavies](https://forum.arduino.cc/u/johnsondavies)\
**Post date:** [June 10, 2023, 6:49am UTC](https://forum.arduino.cc/t/examples-please-for-littlefs/1136267/5 "2023-06-10T06:49:01Z")

</div>

Here's a LittleFS test program that works fine on the IMXRT1062-based Teensy 4.0. It writes four bytes to a file "Test" on LittleFS and then reads them back:

```arduino
#include <LittleFS.h>
LittleFS_Program LittleFS;
  
void setup() {
  Serial.begin(9600);
  delay(3000);
  LittleFS.begin(1024);
}

void loop() {
  File file;
  uint8_t u8[4] = {12, 34, 56, 78};
  Serial.println("Write");
  file = LittleFS.open("Test", FILE_WRITE_BEGIN);
  if (file.write(u8, 4) != 4) Serial.println("Not enough room");
  else Serial.println("Success");
  file.close();
  //
  Serial.println("Read");
  file = LittleFS.open("Test", FILE_READ);
  file.read(u8, 4);
  if (u8[0]==12 && u8[1]==34 && u8[2]==56 && u8[3]==78) Serial.println("Success");
  file.close();
  for(;;);
}

```

Running it on the GIGA produces the following error:

```
LittleFS.h: No such file or directory

```

Looking in the GIGA core I suspect it should be:

```
#include <LittleFileSystem.h>

```

I then get a large number of further errors, including:

```
error: 'LittleFS' was not declared in this scope
error: 'File' was not declared in this scope

```

Any suggestions?

---

_[View the full topic](https://forum.arduino.cc/t/examples-please-for-littlefs/1136267)._
