MCPcopy Create free account
hub / github.com/catboost/catboost / ReadLink

Method ReadLink

util/system/fs.cpp:135–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135TString NFs::ReadLink(const TString& path) {
136#if defined(_win_)
137 return NFsPrivate::WinReadLink(path);
138#elif defined(_unix_)
139 TTempBuf buf;
140 while (true) {
141 ssize_t r = readlink(path.data(), buf.Data(), buf.Size());
142 if (r < 0) {
143 ythrow yexception() << "can't read link " << path << ", errno = " << errno;
144 }
145 if (r < (ssize_t)buf.Size()) {
146 return TString(buf.Data(), r);
147 }
148 buf = TTempBuf(buf.Size() * 2);
149 }
150#endif
151}
152
153void NFs::Cat(const TString& dstPath, const TString& srcPath) {
154 TUnbufferedFileInput src(srcPath);

Callers

nothing calls this directly

Calls 6

WinReadLinkFunction · 0.85
TTempBufClass · 0.85
readlinkFunction · 0.50
dataMethod · 0.45
DataMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected