Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::basic_filebuf<CharT,Traits>::sync

      From cppreference.com
      <cpp‎ |io‎ |basic filebuf
       
       
       
       
      protected:
      virtualint sync()

      If a put area exists (e.g. the file was opened for writing), callsoverflow() to write all pending output to the file, then flushes the file as if by callingstd::fflush.

      If a get area exists (e.g. the file was opened for reading), the effect is implementation-defined. Typical implementation may empty out the get area and move the current file position back by the corresponding number of bytes.

      Contents

      [edit]Parameters

      (none)

      [edit]Return value

      0 in case of success,-1 in case of failure.

      [edit]Notes

      sync() or its equivalent is implicitly called for output streams byclose(),seekoff(), andseekpos() and explicitly called bystd::basic_streambuf::pubsync()

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      invokessync()
      (public member function ofstd::basic_streambuf<CharT,Traits>)[edit]
      synchronizes an output stream with the actual file
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/basic_filebuf/sync&oldid=137785"

      [8]ページ先頭

      ©2009-2025 Movatter.jp