| 240 | } |
| 241 | |
| 242 | void TFileTest::TestRawRead() { |
| 243 | TTempFile tmp("tmp"); |
| 244 | |
| 245 | { |
| 246 | TFile file(tmp.Name(), OpenAlways | WrOnly); |
| 247 | file.Write("1234567", 7); |
| 248 | file.Flush(); |
| 249 | file.Close(); |
| 250 | } |
| 251 | |
| 252 | { |
| 253 | TFile file(tmp.Name(), OpenExisting | RdOnly); |
| 254 | char buf[7]; |
| 255 | i32 reallyRead = file.RawRead(buf, 7); |
| 256 | Y_ENSURE(0 <= reallyRead && reallyRead <= 7); |
| 257 | Y_ENSURE(TStringBuf(buf, reallyRead) == TStringBuf("1234567").Head(reallyRead)); |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | void TFileTest::TestRead() { |
| 262 | TTempFile tmp("tmp"); |