MCPcopy Create free account
hub / github.com/crownengine/crown / stat

Function stat

3rdparty/bx/src/file.cpp:742–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

740 }
741
742 bool stat(FileInfo& _outFileInfo, const FilePath& _filePath)
743 {
744#if BX_CRT_NONE
745 BX_UNUSED(_filePath, _outFileInfo);
746 return false;
747#else
748 _outFileInfo.size = 0;
749 _outFileInfo.type = FileType::Count;
750
751# if BX_COMPILER_MSVC
752 struct ::_stat64 st;
753 int32_t result = ::_stat64(_filePath.getCPtr(), &st);
754
755 if (0 != result)
756 {
757 return false;
758 }
759
760 if (0 != (st.st_mode & _S_IFREG) )
761 {
762 _outFileInfo.type = FileType::File;
763 }
764 else if (0 != (st.st_mode & _S_IFDIR) )
765 {
766 _outFileInfo.type = FileType::Dir;
767 }
768# else
769 struct ::stat st;
770 int32_t result = ::stat(_filePath.getCPtr(), &st);
771 if (0 != result)
772 {
773 return false;
774 }
775
776 if (0 != (st.st_mode & S_IFREG) )
777 {
778 _outFileInfo.type = FileType::File;
779 }
780 else if (0 != (st.st_mode & S_IFDIR) )
781 {
782 _outFileInfo.type = FileType::Dir;
783 }
784# endif // BX_COMPILER_MSVC
785
786 _outFileInfo.size = st.st_size;
787
788 return true;
789#endif // BX_CRT_NONE
790 }
791
792 bool make(const FilePath& _filePath, Error* _err)
793 {

Callers 5

makeAllFunction · 0.70
removeFunction · 0.70
removeAllFunction · 0.70
getEnvFunction · 0.70
getTempPathFunction · 0.70

Calls 1

getCPtrMethod · 0.80

Tested by

no test coverage detected