I'm working with an SD drive plugged into an Arduino Mega.
Is it Ok to remove and replace the SD card whilst the Arduino is powered up? I know that if put the SD card into a laptop I'm supposed to 'eject' the drive before actually removing it, but this is to do with the caching that the laptop does. I know the arduino isn't caching anything so can a remove and replace the card anytime? Obviously if the card is removed during a read or write operation then this will fail, but will it do any permanent damage to the card?
If I remove the card whilst a file is open (but not being changed) will it corrupt the open file? In practice it doesn't seem to, but maybe I've just been lucky?
Writing new data without updating the directory that points to it renders the new data invisible and useless
How do I 'update the directory'?
I've been writing to files in the root directory, after writing I close the file and then it appears to be usable. Am a I supposed to be 'updating the directory' to, or does closing the file automatically update the directory?