"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "html/muscle-by-example/examples/tarfilewriter/example_1_basic_usage.cpp" between
muscle7.61.zip and muscle7.62.zip

About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.

example_1_basic_usage.cpp  (muscle7.61):example_1_basic_usage.cpp  (muscle7.62)
skipping to change at line 23 skipping to change at line 23
static status_t WriteFakeFileDataToTarFile(TarFileWriter & writer, const char * fakeFileName) static status_t WriteFakeFileDataToTarFile(TarFileWriter & writer, const char * fakeFileName)
{ {
#ifdef WIN32 #ifdef WIN32
const uint32 fileMode = 0777; // Windows doesn't have the S_* macros defined :( const uint32 fileMode = 0777; // Windows doesn't have the S_* macros defined :(
#else #else
const uint32 fileMode = S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXO TH; const uint32 fileMode = S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXO TH;
#endif #endif
status_t ret; status_t ret;
if (writer.WriteFileHeader(fakeFileName, fileMode, 0, 0, GetCurrentTime64(), TarFileWriter::TAR_LINK_INDICATOR_NORMAL_FILE, NULL).IsError(ret)) return ret; if (writer.WriteFileHeader(fakeFileName, fileMode, 0, 0, GetCurrentTime64(), TarFileWriter::TAR_LINK_INDICATOR_NORMAL_FILE, NULL, 0).IsError(ret)) return ret ;
// Generate some fake data for our fake file to contain // Generate some fake data for our fake file to contain
uint8 fakeDataBuf[1024]; uint8 fakeDataBuf[1024];
const uint8 dummyBuf[] = "All work and no play make Jack a dull boy. "; const uint8 dummyBuf[] = "All work and no play make Jack a dull boy. ";
for (uint32 i=0; i<sizeof(fakeDataBuf); i++) fakeDataBuf[i] = dummyBuf[i%(siz eof(dummyBuf)-1)]; for (uint32 i=0; i<sizeof(fakeDataBuf); i++) fakeDataBuf[i] = dummyBuf[i%(siz eof(dummyBuf)-1)];
return writer.WriteFileData(fakeDataBuf, sizeof(fakeDataBuf)); return writer.WriteFileData(fakeDataBuf, sizeof(fakeDataBuf));
} }
int main(int argc, char ** argv) int main(int argc, char ** argv)
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)