> if file is to be stored in a local system we make a check to see if required space is there

OK, so how do you currently do that without knowing the size of the buffer? How do you know how much space to check for?