MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / adfFlushFile

Function adfFlushFile

dep/adflib/src/adf_file.c:53–89  ·  view source on GitHub ↗

* adfFileFlush * */

Source from the content-addressed store, hash-verified

51 *
52 */
53void adfFlushFile(struct File *file)
54{
55 struct bEntryBlock parent;
56 struct bOFSDataBlock *data;
57
58 if (file->currentExt) {
59 if (file->writeMode)
60 adfWriteFileExtBlock(file->volume, file->currentExt->headerKey,
61 file->currentExt);
62 }
63 if (file->currentData) {
64 if (file->writeMode) {
65 file->fileHdr->byteSize = file->pos;
66 if (isOFS(file->volume->dosType)) {
67 data = (struct bOFSDataBlock *)file->currentData;
68 data->dataSize = file->posInDataBlk;
69 }
70 if (file->fileHdr->byteSize>0)
71 adfWriteDataBlock(file->volume, file->curDataPtr,
72 file->currentData);
73 }
74 }
75 if (file->writeMode) {
76 file->fileHdr->byteSize = file->pos;
77/*printf("pos=%ld\n",file->pos);*/
78 adfTime2AmigaTime(adfGiveCurrentTime(),
79 &(file->fileHdr->days),&(file->fileHdr->mins),&(file->fileHdr->ticks) );
80 adfWriteFileHdrBlock(file->volume, file->fileHdr->headerKey, file->fileHdr);
81
82 if (isDIRCACHE(file->volume->dosType)) {
83/*printf("parent=%ld\n",file->fileHdr->parent);*/
84 adfReadEntryBlock(file->volume, file->fileHdr->parent, &parent);
85 adfUpdateCache(file->volume, &parent, (struct bEntryBlock*)file->fileHdr,FALSE);
86 }
87 adfUpdateBitmap(file->volume);
88 }
89}
90
91
92/*

Callers 1

adfCloseFileFunction · 0.85

Calls 8

adfWriteFileExtBlockFunction · 0.85
adfWriteDataBlockFunction · 0.85
adfTime2AmigaTimeFunction · 0.85
adfGiveCurrentTimeFunction · 0.85
adfWriteFileHdrBlockFunction · 0.85
adfReadEntryBlockFunction · 0.85
adfUpdateCacheFunction · 0.85
adfUpdateBitmapFunction · 0.85

Tested by

no test coverage detected