summaryrefslogtreecommitdiffstats
path: root/library/cpp/streams
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2023-12-01 16:59:11 +0300
committerrobot-piglet <[email protected]>2023-12-01 19:54:31 +0300
commit3715aa9254f65ae1058290101351a72a6d3a67d4 (patch)
tree9ac5a1cdab42dfc7cd095a06a362e0681cb1482f /library/cpp/streams
parentb20a8c04fb7e595955ca9d1b943033342b6580cb (diff)
Intermediate changes
Diffstat (limited to 'library/cpp/streams')
-rw-r--r--library/cpp/streams/growing_file_input/growing_file_input.cpp40
-rw-r--r--library/cpp/streams/growing_file_input/growing_file_input.h23
-rw-r--r--library/cpp/streams/growing_file_input/ya.make11
3 files changed, 0 insertions, 74 deletions
diff --git a/library/cpp/streams/growing_file_input/growing_file_input.cpp b/library/cpp/streams/growing_file_input/growing_file_input.cpp
deleted file mode 100644
index 0bbfa5ade9e..00000000000
--- a/library/cpp/streams/growing_file_input/growing_file_input.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "growing_file_input.h"
-
-#include <util/datetime/base.h>
-#include <util/generic/yexception.h>
-
-TGrowingFileInput::TGrowingFileInput(const TString& path)
- : File_(path, OpenExisting | RdOnly | Seq)
-{
- if (!File_.IsOpen()) {
- ythrow TIoException() << "file " << path << " not open";
- }
-
- File_.Seek(0, sEnd);
-}
-
-TGrowingFileInput::TGrowingFileInput(const TFile& file)
- : File_(file)
-{
- if (!File_.IsOpen()) {
- ythrow TIoException() << "file (" << file.GetName() << ") not open";
- }
-
- File_.Seek(0, sEnd);
-}
-
-size_t TGrowingFileInput::DoRead(void* buf, size_t len) {
- for (int sleepTime = 1;;) {
- size_t rr = File_.Read(buf, len);
-
- if (rr != 0) {
- return rr;
- }
-
- NanoSleep((ui64)sleepTime * 1000000);
-
- if (sleepTime < 2000) {
- sleepTime <<= 1;
- }
- }
-}
diff --git a/library/cpp/streams/growing_file_input/growing_file_input.h b/library/cpp/streams/growing_file_input/growing_file_input.h
deleted file mode 100644
index 9054a5f3dac..00000000000
--- a/library/cpp/streams/growing_file_input/growing_file_input.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma once
-
-#include <util/stream/input.h>
-#include <util/system/file.h>
-
-/**
- * Growing file input stream.
- *
- * File descriptor offsets to the end of the file, when the object is created.
- *
- * Read function waites for reading at least one byte.
- */
-class TGrowingFileInput: public IInputStream {
-public:
- TGrowingFileInput(const TFile& file);
- TGrowingFileInput(const TString& path);
-
-private:
- size_t DoRead(void* buf, size_t len) override;
-
-private:
- TFile File_;
-};
diff --git a/library/cpp/streams/growing_file_input/ya.make b/library/cpp/streams/growing_file_input/ya.make
deleted file mode 100644
index 69c56fea462..00000000000
--- a/library/cpp/streams/growing_file_input/ya.make
+++ /dev/null
@@ -1,11 +0,0 @@
-LIBRARY()
-
-SRCS(
- growing_file_input.cpp
-)
-
-END()
-
-RECURSE_FOR_TESTS(
- ut
-)