summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-11-02 15:59:30 +0000
committerNicholas Clark <nick@ccl4.org>2005-11-02 15:59:30 +0000
commit957b0e1df4e0ae2e09b90343a5735128715ba230 (patch)
treedd6f40e5a4e2ba2f4d8eaacfef382d0c9ad718b1 /pp_sys.c
parent9da9462bb3e8caa6ed89b73deed69ec85fa59066 (diff)
downloadperl-957b0e1df4e0ae2e09b90343a5735128715ba230.tar.gz
Merge ftsize ftmtime ftatime ftctime into Perl_pp_ftis
p4raw-id: //depot/perl@25958
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c81
1 files changed, 24 insertions, 57 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 0bf34cb4d4..3f0a25ba35 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3052,7 +3052,30 @@ PP(pp_ftis)
SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
- RETPUSHYES;
+ {
+ dTARGET;
+ switch (PL_op->op_type) {
+ case OP_FTIS:
+ RETPUSHYES;
+ case OP_FTSIZE:
+#if Off_t_size > IVSIZE
+ PUSHn(PL_statcache.st_size);
+#else
+ PUSHi(PL_statcache.st_size);
+#endif
+ break;
+ case OP_FTMTIME:
+ PUSHn( (((NV)PL_basetime - PL_statcache.st_mtime)) / 86400.0 );
+ break;
+ case OP_FTATIME:
+ PUSHn( (((NV)PL_basetime - PL_statcache.st_atime)) / 86400.0 );
+ break;
+ case OP_FTCTIME:
+ PUSHn( (((NV)PL_basetime - PL_statcache.st_ctime)) / 86400.0 );
+ break;
+ }
+ }
+ RETURN;
}
PP(pp_ftrowned)
@@ -3084,62 +3107,6 @@ PP(pp_ftzero)
RETPUSHNO;
}
-PP(pp_ftsize)
-{
- I32 result;
- dSP; dTARGET;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
-#if Off_t_size > IVSIZE
- PUSHn(PL_statcache.st_size);
-#else
- PUSHi(PL_statcache.st_size);
-#endif
- RETURN;
-}
-
-PP(pp_ftmtime)
-{
- I32 result;
- dSP; dTARGET;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- PUSHn( (((NV)PL_basetime - PL_statcache.st_mtime)) / 86400.0 );
- RETURN;
-}
-
-PP(pp_ftatime)
-{
- I32 result;
- dSP; dTARGET;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- PUSHn( (((NV)PL_basetime - PL_statcache.st_atime)) / 86400.0 );
- RETURN;
-}
-
-PP(pp_ftctime)
-{
- I32 result;
- dSP; dTARGET;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- PUSHn( (((NV)PL_basetime - PL_statcache.st_ctime)) / 86400.0 );
- RETURN;
-}
-
PP(pp_ftsock)
{
I32 result;