mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
Utilities/unzip: Use Core::Directory to create output directory
This commit is contained in:
parent
72893b4f9e
commit
f92312e778
1 changed files with 2 additions and 4 deletions
|
@ -10,11 +10,11 @@
|
||||||
#include <LibArchive/Zip.h>
|
#include <LibArchive/Zip.h>
|
||||||
#include <LibCompress/Deflate.h>
|
#include <LibCompress/Deflate.h>
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
|
#include <LibCore/Directory.h>
|
||||||
#include <LibCore/File.h>
|
#include <LibCore/File.h>
|
||||||
#include <LibCore/MappedFile.h>
|
#include <LibCore/MappedFile.h>
|
||||||
#include <LibCore/System.h>
|
#include <LibCore/System.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
static bool unpack_zip_member(Archive::ZipMember zip_member, bool quiet)
|
static bool unpack_zip_member(Archive::ZipMember zip_member, bool quiet)
|
||||||
{
|
{
|
||||||
|
@ -120,9 +120,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!output_directory_path.is_null()) {
|
if (!output_directory_path.is_null()) {
|
||||||
auto mkdir_error = Core::System::mkdir(output_directory_path, 0755);
|
TRY(Core::Directory::create(output_directory_path, Core::Directory::CreateDirectories::Yes));
|
||||||
if (mkdir_error.is_error() && mkdir_error.error().code() != EEXIST)
|
|
||||||
return mkdir_error.release_error();
|
|
||||||
TRY(Core::System::chdir(output_directory_path));
|
TRY(Core::System::chdir(output_directory_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue