On 06/05/2013 09:33 PM, ravim wrote:
> I wanted to ask -  is it possible that portion of data packet may be written
> to file when SD card is suddenly pulled out? Because if this happens the
> whole series of binary data will not make any sense or may give us totally
> wrong information.
> 
> If this happens how do we handle it? Is there a way to make this write
> operation atomic??
> 

All writes are of 512 byte blocks. The SD card will buffer the data you
transfer to it and only once you have sent a full block will it begin
its internal write operation.

So if the card is pulled in the middle of the transfer, then all data in
that block is lost. If it is pulled after the transfer is complete but
before the internal write operation is finished, then the results are
unknown.

If users pulling out a card in the middle of an operation is expected to
be a problem then you must use a data structure that will tolerate that.

-- 
David W. Schultz
http://home.earthlink.net/~david.schultz
Returned for Regrooving



------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to