@@ -5143,8 +5143,8 @@ void CWsWuFileHelper::readLocalFileToBuffer(const char* file, offset_t sizeLimit
51435143 throw MakeStringException (ECLWATCH_CANNOT_READ_FILE, " Cannot read %s." , file);
51445144}
51455145
5146- void CWsWuFileHelper::createHelperFileArchive (IEspContext& context, const char * wuid,
5147- IArrayOf<IConstWUFileOption>& wuFileOptions, bool useGZip, MemoryBuffer& result, StringBuffer& archiveFileName)
5146+ IFileIOStream* CWsWuFileHelper::createHelperFileArchive (IEspContext& context, const char * wuid,
5147+ IArrayOf<IConstWUFileOption>& wuFileOptions, bool useGZip, StringBuffer& archiveFileName)
51485148{
51495149 StringBuffer namePrefixStr, workingFolder;
51505150 Owned<IFile> workingDir = createWorkingFolder (context, wuid, " WUHelpers_" , namePrefixStr, workingFolder);
@@ -5187,13 +5187,10 @@ void CWsWuFileHelper::createHelperFileArchive(IEspContext& context, const char*
51875187 if (zipRet != 0 )
51885188 throw makeStringExceptionV (ECLWATCH_CANNOT_COMPRESS_DATA, " Failed to create helper file archive for workunit %s." , wuid);
51895189
5190- Owned<IFile> zipFile = createIFile (zipFileNameWithPath.str ());
5191- Owned<IFileIO> zipIO = zipFile->open (IFOread);
5192- size32_t zipSize = (size32_t ) zipIO->size ();
5193- void * data = result.reserve (zipSize);
5194- result.setLength (zipIO->read (0 , zipSize, data));
5195- zipIO->close ();
5196- zipFile->remove ();
5190+ IFileIOStream* stream = createIOStreamFromFile (zipFileNameWithPath.str (), IFOread);
5191+ if (!stream)
5192+ throw makeStringExceptionV (ECLWATCH_INTERNAL_ERROR, " Cannot open stream for archive file %s" , zipFileNameWithPath.str ());
5193+ return stream;
51975194}
51985195
51995196void CWsWuEmailHelper::send (const char * body, const void * attachment, size32_t lenAttachment, StringArray& warnings)
0 commit comments