Problem uploading

Please read how to use the forum and use code tag afetr indenting code correctly

So that your code above appears like this

// some nice code here presented the right way

// may be you are missing this after changing the directory to /
sd.vwd()->rewind();

Too painful to read at the moment like you copied it