PathTools
view release on metacpan or search on metacpan
CODE:
PERL_UNUSED_VAR(items);
{ MY_CXT_CLONE; POPULATE_MY_CXT; }
#endif
void
getcwd(...)
ALIAS:
fastcwd=1
PPCODE:
{
dXSTARG;
/* fastcwd takes zero parameters: */
if (ix == 1 && items != 0)
croak_xs_usage(cv, "");
getcwd_sv(TARG);
XSprePUSH; PUSHTARG;
SvTAINTED_on(TARG);
}
void
abs_path(pathsv=Nullsv)
SV *pathsv
PPCODE:
{
dXSTARG;
char *const path = pathsv ? SvPV_nolen(pathsv) : (char *)".";
char buf[MAXPATHLEN];
if (
#ifdef VMS
Perl_rmsexpand(aTHX_ path, buf, NULL, 0)
#else
bsd_realpath(path, buf)
XSprePUSH; PUSHs(TARG);
SvTAINTED_on(TARG);
}
#if defined(WIN32) && !defined(UNDER_CE)
void
getdcwd(...)
PROTOTYPE: ENABLE
PPCODE:
{
dXSTARG;
int drive;
char *dir;
/* Drive 0 is the current drive, 1 is A:, 2 is B:, 3 is C: and so on. */
if ( items == 0 ||
(items == 1 && (!SvOK(ST(0)) || (SvPOK(ST(0)) && !SvCUR(ST(0))))))
drive = 0;
else if (items == 1 && SvPOK(ST(0)) && SvCUR(ST(0)) &&
( run in 1.226 second using v1.01-cache-2.11-cpan-5511b514fd6 )