Filesys-Df
view release on metacpan or search on metacpan
typedef struct statfs Statfs;
MODULE = Filesys::Df PACKAGE = Filesys::Df
void
_df(dir)
char *dir
PREINIT:
Statfs st;
PPCODE:
EXTEND(sp, 7);
#ifdef DF_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 DF_SOLARIS
PUSHs(sv_2mortal(newSVuv(0)));
PUSHs(sv_2mortal(newSVuv(0)));
PUSHs(sv_2mortal(newSVuv(0)));
}
void
_df_fh(fd)
int fd
PREINIT:
Statfs st;
PPCODE:
EXTEND(sp, 7);
#ifdef DF_SOLARIS
if(fstatfs(fd, &st, 0, 0) == 0) {
#else
if(fstatfs(fd, &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 DF_SOLARIS
MODULE = Filesys::Df PACKAGE = Filesys::Df
void
_df(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)));
PUSHs(sv_2mortal(newSVuv(0)));
PUSHs(sv_2mortal(newSVuv(0)));
PUSHs(sv_2mortal(newSVuv(0)));
}
void
_df_fh(fd)
int fd;
PREINIT:
Statvfs st;
PPCODE:
EXTEND(sp, 7);
if(fstatvfs(fd, &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)));
( run in 1.655 second using v1.01-cache-2.11-cpan-71847e10f99 )