mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
LibCore: Remove standard I/O from DeprecatedFile
This commit is contained in:
parent
b65d49669a
commit
d5c13a3cbc
2 changed files with 0 additions and 35 deletions
|
@ -242,37 +242,6 @@ ErrorOr<DeprecatedString> DeprecatedFile::read_link(DeprecatedString const& link
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static RefPtr<DeprecatedFile> stdin_file;
|
|
||||||
static RefPtr<DeprecatedFile> stdout_file;
|
|
||||||
static RefPtr<DeprecatedFile> stderr_file;
|
|
||||||
|
|
||||||
NonnullRefPtr<DeprecatedFile> DeprecatedFile::standard_input()
|
|
||||||
{
|
|
||||||
if (!stdin_file) {
|
|
||||||
stdin_file = DeprecatedFile::construct();
|
|
||||||
stdin_file->open(STDIN_FILENO, OpenMode::ReadOnly, ShouldCloseFileDescriptor::No);
|
|
||||||
}
|
|
||||||
return *stdin_file;
|
|
||||||
}
|
|
||||||
|
|
||||||
NonnullRefPtr<DeprecatedFile> DeprecatedFile::standard_output()
|
|
||||||
{
|
|
||||||
if (!stdout_file) {
|
|
||||||
stdout_file = DeprecatedFile::construct();
|
|
||||||
stdout_file->open(STDOUT_FILENO, OpenMode::WriteOnly, ShouldCloseFileDescriptor::No);
|
|
||||||
}
|
|
||||||
return *stdout_file;
|
|
||||||
}
|
|
||||||
|
|
||||||
NonnullRefPtr<DeprecatedFile> DeprecatedFile::standard_error()
|
|
||||||
{
|
|
||||||
if (!stderr_file) {
|
|
||||||
stderr_file = DeprecatedFile::construct();
|
|
||||||
stderr_file->open(STDERR_FILENO, OpenMode::WriteOnly, ShouldCloseFileDescriptor::No);
|
|
||||||
}
|
|
||||||
return *stderr_file;
|
|
||||||
}
|
|
||||||
|
|
||||||
static DeprecatedString get_duplicate_name(DeprecatedString const& path, int duplicate_count)
|
static DeprecatedString get_duplicate_name(DeprecatedString const& path, int duplicate_count)
|
||||||
{
|
{
|
||||||
if (duplicate_count == 0) {
|
if (duplicate_count == 0) {
|
||||||
|
|
|
@ -82,10 +82,6 @@ public:
|
||||||
bool open(int fd, OpenMode, ShouldCloseFileDescriptor);
|
bool open(int fd, OpenMode, ShouldCloseFileDescriptor);
|
||||||
[[nodiscard]] int leak_fd();
|
[[nodiscard]] int leak_fd();
|
||||||
|
|
||||||
static NonnullRefPtr<DeprecatedFile> standard_input();
|
|
||||||
static NonnullRefPtr<DeprecatedFile> standard_output();
|
|
||||||
static NonnullRefPtr<DeprecatedFile> standard_error();
|
|
||||||
|
|
||||||
static Optional<DeprecatedString> resolve_executable_from_environment(StringView filename);
|
static Optional<DeprecatedString> resolve_executable_from_environment(StringView filename);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue