[ox/fs] Make PassthroughFS mkdir pass mkdir -p on existing directory
This commit is contained in:
		@@ -7,6 +7,7 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "passthroughfs.hpp"
 | 
					#include "passthroughfs.hpp"
 | 
				
			||||||
 | 
					#include <filesystem>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(OX_HAS_PASSTHROUGHFS)
 | 
					#if defined(OX_HAS_PASSTHROUGHFS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -31,7 +32,11 @@ Error PassThroughFS::mkdir(const char *path, bool recursive) {
 | 
				
			|||||||
	const auto u8p = p.u8string();
 | 
						const auto u8p = p.u8string();
 | 
				
			||||||
	oxTrace("ox::fs::PassThroughFS::mkdir") << u8p.c_str();
 | 
						oxTrace("ox::fs::PassThroughFS::mkdir") << u8p.c_str();
 | 
				
			||||||
	if (recursive) {
 | 
						if (recursive) {
 | 
				
			||||||
 | 
							if (std::filesystem::is_directory(p)) {
 | 
				
			||||||
 | 
								success = true;
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
			success = std::filesystem::create_directories(p);
 | 
								success = std::filesystem::create_directories(p);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		success = std::filesystem::create_directory(p);
 | 
							success = std::filesystem::create_directory(p);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user