I open the file: fopen_s(&file, filepath, mode); Is it possible to find out any function from file , in which mode the file is open: "r", "w", "r+", "w+", "a", "a+" ?

  • 2
    Why not continue to use the value of the mode variable? - Pavel Parshin
  • The @PavelParshin thing is that there is no mode variable, I first open the file in "r +", if there is no file, then in "w". And so for several files. It would not have been convenient to store a bunch of modes in a separate vector for each file - Dmitry
  • How reliable is the solution? For which OS, compilers? - ixSci
  • @ixSci will now add to question labels. What is meant by reliability? - Dmitry
  • 2
    @Dmitry, you can write a wrapper over FILE with the storage of the current mode. - Pavel Parshin

0