Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::filesystem::is_regular_file

      From cppreference.com
      <cpp‎ |experimental‎ |fs
       
       
       
      Filesystem library
      Classes
      Functions
      File types
       
      Defined in header<experimental/filesystem>
      bool is_regular_file( file_status s);
      (1)(filesystem TS)
      bool is_regular_file(const path& p);
      (2)(filesystem TS)
      bool is_regular_file(const path& p, error_code& ec);
      (3)(filesystem TS)

      Checks if the given file status or path corresponds to a regular file.

      1) Equivalent tos.type()== file_type::regular.
      2) Equivalent tois_regular_file(status(p)).
      3) Equivalent tois_regular_file(status(p, ec)). Returnsfalse and setsec to an appropriate error code if an error occurs. Otherwise,ec is cleared with a call toec.clear().
      This section is incomplete
      Reason: the specification says that (2) throws filesystem_error if status(p) would throw filesystem_error. This is different from the rest of is_**_file functions. Is that correct and if yes, what's the rationale?

      Contents

      [edit]Parameters

      s - file status to check
      p - path to examine
      ec - error code to store the error status to

      [edit]Return value

      true if the given path or file status corresponds to a regular link,false otherwise.

      [edit]Exceptions

      1,3)
      noexcept specification:  
      noexcept
        
      2) Throwsfilesystem_error if an error occurs. The error is constructed withp as an argument. The error code is set to an appropriate error code for the error that caused the failure.

      [edit]See also

      This section is incomplete
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/fs/is_regular_file&oldid=154856"

      [8]ページ先頭

      ©2009-2026 Movatter.jp