question regarding.flush() command

You need to check the doc's/code for your SD lib. Close should flush the tx/out going buffer before closing it. But some authors are stupid enough to think that flush should throw away the input buffer.

By the way the term is NOT command it is method or function Google the wrong term you get bad results.

Mark