- Timestamp:
- Nov 24, 2009 11:09:45 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/file.h
r24189 r24889 643 643 * 644 644 * @returns iprt status code. 645 * @returns VERR_NOT_SUPPORTED is returned if the operation isn't supported by the OS. 645 * @retval VERR_NOT_SUPPORTED is returned if the operation isn't supported by 646 * the OS. 646 647 * 647 648 * @param File Handle to the file. … … 744 745 */ 745 746 RTR3DECL(int) RTFileIoCtl(RTFILE File, int iRequest, void *pvData, unsigned cbData, int *piRet); 747 748 /** 749 * Query the sizes of a filesystem. 750 * 751 * @returns iprt status code. 752 * @retval VERR_NOT_SUPPORTED is returned if the operation isn't supported by 753 * the OS. 754 * 755 * @param hFile The file handle. 756 * @param pcbTotal Where to store the total filesystem space. (Optional) 757 * @param pcbFree Where to store the remaining free space in the filesystem. (Optional) 758 * @param pcbBlock Where to store the block size. (Optional) 759 * @param pcbSector Where to store the sector size. (Optional) 760 * 761 * @sa RTFsQuerySizes 762 */ 763 RTR3DECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree, 764 uint32_t *pcbBlock, uint32_t *pcbSector); 746 765 747 766 /** -
trunk/include/iprt/fs.h
r20374 r24889 341 341 * @param pcbBlock Where to store the block size. (Optional) 342 342 * @param pcbSector Where to store the sector size. (Optional) 343 * 344 * @sa RTFileQueryFsSizes 343 345 */ 344 346 RTR3DECL(int) RTFsQuerySizes(const char *pszFsPath, PRTFOFF pcbTotal, RTFOFF *pcbFree, -
trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp
r24585 r24889 47 47 # include <unistd.h> 48 48 # include <sys/time.h> 49 # include <sys/statvfs.h> 49 50 #endif 50 51 #ifdef RT_OS_LINUX … … 718 719 719 720 721 RTR3DECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree, 722 uint32_t *pcbBlock, uint32_t *pcbSector) 723 { 724 struct statvfs StatVFS; 725 RT_ZERO(StatVFS); 726 if (fstatvfs(hFile, &StatVFS)) 727 return RTErrConvertFromErrno(errno); 728 729 /* 730 * Calc the returned values. 731 */ 732 if (pcbTotal) 733 *pcbTotal = (RTFOFF)StatVFS.f_blocks * StatVFS.f_frsize; 734 if (pcbFree) 735 *pcbFree = (RTFOFF)StatVFS.f_bavail * StatVFS.f_frsize; 736 if (pcbBlock) 737 *pcbBlock = StatVFS.f_frsize; 738 /* no idea how to get the sector... */ 739 if (pcbSector) 740 *pcbSector = 512; 741 742 return VINF_SUCCESS; 743 } 744 745 746 720 747 RTR3DECL(int) RTFileRename(const char *pszSrc, const char *pszDst, unsigned fRename) 721 748 { -
trunk/src/VBox/Runtime/r3/win/fileio-win.cpp
r24341 r24889 790 790 791 791 792 RTR3DECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree, 793 uint32_t *pcbBlock, uint32_t *pcbSector) 794 { 795 return VERR_NOT_SUPPORTED; 796 } 797 798 792 799 RTR3DECL(int) RTFileDelete(const char *pszFilename) 793 800 {
Note:
See TracChangeset
for help on using the changeset viewer.