| 
1 | 1 | #include "files.h"  | 
2 | 2 | 
 
  | 
3 |  | -#include <cage-core/concurrent.h>  | 
4 | 3 | #include <cage-core/debug.h>  | 
5 | 4 | #include <cage-core/lineReader.h>  | 
6 | 5 | #include <cage-core/math.h> // min  | 
7 |  | -#include <cage-core/memoryBuffer.h>  | 
8 | 6 | #include <cage-core/pointerRangeHolder.h>  | 
9 | 7 | #include <cage-core/string.h>  | 
10 | 8 | 
 
  | 
11 | 9 | namespace cage  | 
12 | 10 | {  | 
13 |  | -	void archiveCreateZip(const String &path, const String &options);  | 
 | 11 | +	void archiveCreateZip(const String &path);  | 
 | 12 | +	void archiveCreateCarch(const String &path);  | 
14 | 13 | 
 
  | 
15 | 14 | 	bool FileMode::valid() const  | 
16 | 15 | 	{  | 
@@ -134,7 +133,7 @@ namespace cage  | 
134 | 133 | 		CAGE_THROW_CRITICAL(Exception, "calling mode on an abstract file");  | 
135 | 134 | 	}  | 
136 | 135 | 
 
  | 
137 |  | -	Holder<File> newFile(const String &path, const FileMode &mode)  | 
 | 136 | +	Holder<File> newFile(const String &path, FileMode mode)  | 
138 | 137 | 	{  | 
139 | 138 | 		ScopeLock lock(fsMutex());  | 
140 | 139 | 		auto [a, p] = archiveFindTowardsRoot(path, ArchiveFindModeEnum::FileExclusive);  | 
@@ -267,15 +266,26 @@ namespace cage  | 
267 | 266 | 		a->createDirectories(p);  | 
268 | 267 | 	}  | 
269 | 268 | 
 
  | 
270 |  | -	void pathCreateArchive(const String &path, const String &options)  | 
 | 269 | +	void pathCreateArchiveZip(const String &path)  | 
271 | 270 | 	{  | 
272 | 271 | 		ScopeLock lock(fsMutex());  | 
273 | 272 | 		if (any(pathType(path) & (PathTypeFlags::File | PathTypeFlags::Directory | PathTypeFlags::Archive)))  | 
274 | 273 | 		{  | 
275 | 274 | 			CAGE_LOG_THROW(Stringizer() + "path: " + path);  | 
276 | 275 | 			CAGE_THROW_ERROR(Exception, "cannot create archive, the path already exists");  | 
277 | 276 | 		}  | 
278 |  | -		archiveCreateZip(path, options);  | 
 | 277 | +		archiveCreateZip(path);  | 
 | 278 | +	}  | 
 | 279 | + | 
 | 280 | +	void pathCreateArchiveCarch(const String &path)  | 
 | 281 | +	{  | 
 | 282 | +		ScopeLock lock(fsMutex());  | 
 | 283 | +		if (any(pathType(path) & (PathTypeFlags::File | PathTypeFlags::Directory | PathTypeFlags::Archive)))  | 
 | 284 | +		{  | 
 | 285 | +			CAGE_LOG_THROW(Stringizer() + "path: " + path);  | 
 | 286 | +			CAGE_THROW_ERROR(Exception, "cannot create archive, the path already exists");  | 
 | 287 | +		}  | 
 | 288 | +		archiveCreateCarch(path);  | 
279 | 289 | 	}  | 
280 | 290 | 
 
  | 
281 | 291 | 	namespace  | 
 | 
0 commit comments