1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 10:17:35 +00:00

LibCore+Userland: Remove File::ensure_parent_directories

We have a much safer and more powerful alternative now, so let's move
the few users over.
This commit is contained in:
kleines Filmröllchen 2022-04-10 20:51:01 +02:00 committed by Andreas Kling
parent 0fd09b2381
commit 5319e3a03f
7 changed files with 14 additions and 48 deletions

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibCore/File.h>
#include <LibCore/Directory.h>
#include <LibCore/LockFile.h>
#include <errno.h>
#include <fcntl.h>
@ -16,7 +16,7 @@ namespace Core {
LockFile::LockFile(char const* filename, Type type)
: m_filename(filename)
{
if (!Core::File::ensure_parent_directories(m_filename))
if (Core::Directory::create(LexicalPath(m_filename).parent(), Core::Directory::CreateDirectories::Yes).is_error())
return;
m_fd = open(filename, O_RDONLY | O_CREAT | O_CLOEXEC, 0666);