Code Monkey home page Code Monkey logo

Comments (5)

nostar avatar nostar commented on August 16, 2024

Nevermind looks like I figured it out. Using SdFile::open() instead of SdFat::open() lets my create my 18 character alphanumeric file.

from sdfat.

greiman avatar greiman commented on August 16, 2024

You should be able to create a long file name for write like this:

myFile = SD.open("test long name.txt", FILE_WRITE);

Where SD is declared like this:

SdFat SD;

from sdfat.

nostar avatar nostar commented on August 16, 2024

FYI that does not work for me. No file is created unless the filename is 8.3 compliant. What did work was SdFile::open() instead of SdFat::open() :

SdFat SD;
SdFile myfile;
SD.begin(SD_CS);
myfile.open("123456789012345678.bin", O_RDWR | O_CREAT) ;

from sdfat.

greiman avatar greiman commented on August 16, 2024

I downloaded the current zip for this repository.

I ran this program. It printed "yes". I found the file 123456789012345678.bin on the SD.

#include <SPI.h>
#include <SdFat.h>
#define SD_CS_PIN 10

SdFat SD;

File myFile;

void setup() {
  Serial.begin(9600);
  SD.begin(SD_CS_PIN);
  myFile = SD.open("123456789012345678.bin", O_RDWR | O_CREAT);
  myFile.close();
  if (SD.exists("123456789012345678.bin")) {
    Serial.println("yes");
  } else {
    Serial.println("no");
  }
}

void loop() {
}

from sdfat.

nostar avatar nostar commented on August 16, 2024

Oops. I was using FILE_WRITE, not O_RDWR | O_CREAT, with SD.open().

On Tue, Aug 4, 2015 at 12:05 PM, Bill Greiman [email protected]
wrote:

I downloaded the current zip for this repository.

I ran this program. It printed "yes". I found the file
123456789012345678.bin on the SD.

#include <SPI.h>
#include <SdFat.h>
#define SD_CS_PIN 10

SdFat SD;

File myFile;

void setup() {
Serial.begin(9600);
SD.begin(SD_CS_PIN);
myFile = SD.open("123456789012345678.bin", O_RDWR | O_CREAT);
myFile.close();
if (SD.exists("123456789012345678.bin")) {
Serial.println("yes");
} else {
Serial.println("no");
}
}

void loop() {
}


Reply to this email directly or view it on GitHub
#17 (comment).

from sdfat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.