Filesys-DfPortable
view release on metacpan or search on metacpan
typedef struct statfs Statfs;
MODULE = Filesys::DfPortable PACKAGE = Filesys::DfPortable
void
_dfportable(dir)
char *dir
PREINIT:
Statfs st;
PPCODE:
EXTEND(sp, 7);
#ifdef DFPORTABLE_SOLARIS
if(statfs(dir, &st, 0, 0) == 0) {
#else
if(statfs(dir, &st) == 0) {
#endif
PUSHs(sv_2mortal(newSVnv((double)st.f_bsize)));
PUSHs(sv_2mortal(newSVnv((double)st.f_blocks)));
PUSHs(sv_2mortal(newSVnv((double)st.f_bfree)));
#ifdef DFPORTABLE_SOLARIS
MODULE = Filesys::DfPortable PACKAGE = Filesys::DfPortable
void
_dfportable(dir)
char *dir
PREINIT:
Statvfs st;
PPCODE:
EXTEND(sp, 7);
if(statvfs(dir, &st) == 0) {
/* Push values as doubles because we don't know size */
PUSHs(sv_2mortal(newSVnv((double)st.f_frsize)));
PUSHs(sv_2mortal(newSVnv((double)st.f_blocks)));
PUSHs(sv_2mortal(newSVnv((double)st.f_bfree)));
PUSHs(sv_2mortal(newSVnv((double)st.f_bavail)));
PUSHs(sv_2mortal(newSVnv((double)st.f_files)));
PUSHs(sv_2mortal(newSVnv((double)st.f_ffree)));
LPCSTR pszDrive
PREINIT:
__int64 i64FreeBytesToCaller, i64TotalBytes, i64FreeBytes;
BOOL fResult;
DWORD dwSectPerClust,
dwBytesPerSect,
dwFreeClusters,
dwTotalClusters;
PPCODE:
typedef BOOL (WINAPI *PGETDISKFREESPACEEX)(LPCSTR,
PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER);
PGETDISKFREESPACEEX pGetDiskFreeSpaceEx;
pGetDiskFreeSpaceEx = (PGETDISKFREESPACEEX) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetDiskFreeSpaceExA");
EXTEND(sp, 7);
if(pGetDiskFreeSpaceEx) {
fResult = pGetDiskFreeSpaceEx (pszDrive,
( run in 1.769 second using v1.01-cache-2.11-cpan-71847e10f99 )