Arduino - Libraries to write and read data?

Is it possible to write and read data from a USB drive or attached memory card? I like to read data to use in the program.
Is there libraries?


SD cards can be most simply interfaced using SPI. The tricky thing is the file management (FAT). Have a look at this library
Some versions of ethernet shields contain SD card sockets, as the communication to them uses SPI anyhow.

USB is another thing. The amount of code needed to handle any host USB protocol (even USB to go) is considerable and would most likely not fit into a 328. The hardware itself is not so complex. However there might exist some USB Host chip or soon coming...

This will give you some background

As @deSilva said, talking to a USB memory stick isn't something you'd want to do directly from an Arduino. There are host chips you can use though, like the VNC1L from Vinculum. It's available either as a bare chip or in a module that you can use in your own projects, called the VDIP1 and VDIP2:

There's an example of how to use those with Arduino in the "Vehicle Telemetry Platform" project in Practical Arduino, which uses a USB memory stick to log GPS and engine management system data:


If you don't care about file system on USB drive, here's how you can do it using usb host shield ->