MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / Open

Method Open

src/Setup/unzip.cpp:3768–3790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3766
3767
3768ZRESULT TUnzip::Open(void *z,unsigned int len,DWORD flags)
3769{ if (uf!=0 || currentfile!=-1) return ZR_NOTINITED;
3770 //
3771#ifdef GetCurrentDirectory
3772 GetCurrentDirectory(MAX_PATH,rootdir);
3773#else
3774 _tcscpy(rootdir,_T("\\"));
3775#endif
3776 TCHAR lastchar = rootdir[_tcslen(rootdir)-1];
3777 if (lastchar!='\\' && lastchar!='/') _tcscat_s(rootdir,_T("\\"));
3778 //
3779 if (flags==ZIP_HANDLE)
3780 { // test if we can seek on it. We can't use GetFileType(h)==FILE_TYPE_DISK since it's not on CE.
3781 DWORD res = SetFilePointer(z,0,0,FILE_CURRENT);
3782 bool canseek = (res!=0xFFFFFFFF);
3783 if (!canseek) return ZR_SEEK;
3784 }
3785 ZRESULT e; LUFILE *f = lufopen(z,len,flags,&e);
3786 if (f==NULL) return e;
3787 uf = unzOpenInternal(f);
3788 if (uf==0) return ZR_NOFILE;
3789 return ZR_OK;
3790}
3791
3792ZRESULT TUnzip::SetUnzipBaseDir(const TCHAR *dir)
3793{

Callers 5

IsDotNetInstalledMethod · 0.45
WriteRunOnceEntryMethod · 0.45
OpenZipInternalFunction · 0.45
SetupLogLoggerMethod · 0.45

Calls 2

lufopenFunction · 0.85
unzOpenInternalFunction · 0.85

Tested by 1