diff --git a/Userland/Applications/FileManager/FileUtils.cpp b/Userland/Applications/FileManager/FileUtils.cpp index 96fcb4cec09..ef6aa1043fa 100644 --- a/Userland/Applications/FileManager/FileUtils.cpp +++ b/Userland/Applications/FileManager/FileUtils.cpp @@ -50,7 +50,7 @@ ErrorOr run_file_operation(FileOperation operation, Vector const& TRY(Core::System::close(pipe_fds[0])); TRY(Core::System::dup2(pipe_fds[1], STDOUT_FILENO)); - Vector file_operation_args; + Vector file_operation_args; file_operation_args.append("/bin/FileOperation"); switch (operation) { @@ -68,17 +68,12 @@ ErrorOr run_file_operation(FileOperation operation, Vector const& } for (auto& source : sources) - file_operation_args.append(source.characters()); + file_operation_args.append(source.view()); if (operation != FileOperation::Delete) - file_operation_args.append(destination.characters()); + file_operation_args.append(destination.view()); - file_operation_args.append(nullptr); - - if (execvp(file_operation_args.first(), const_cast(file_operation_args.data())) < 0) { - perror("execvp"); - _exit(1); - } + TRY(Core::System::exec(file_operation_args.first(), file_operation_args, Core::System::SearchInPath::Yes)); VERIFY_NOT_REACHED(); } else { TRY(Core::System::close(pipe_fds[1]));