The R Project SVN R

Rev

Rev 32874 | Rev 35266 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32874 Rev 33297
Line 62... Line 62...
62
 
62
 
63
double R_FileMtime(char *path)
63
double R_FileMtime(char *path)
64
{
64
{
65
    struct stat sb;
65
    struct stat sb;
66
    if (stat(R_ExpandFileName(path), &sb) != 0)
66
    if (stat(R_ExpandFileName(path), &sb) != 0)
67
	error(_("cannot determine file modification time of %s"), path);
67
	error(_("cannot determine file modification time of '%s'"), path);
68
    return sb.st_mtime;
68
    return sb.st_mtime;
69
}
69
}
70
#else
70
#else
71
Rboolean R_FileExists(char *path)
71
Rboolean R_FileExists(char *path)
72
{
72
{
Line 138... Line 138...
138
    pattern = CAR(args); n1 = length(pattern);
138
    pattern = CAR(args); n1 = length(pattern);
139
    tempdir = CADR(args); n2 = length(tempdir);
139
    tempdir = CADR(args); n2 = length(tempdir);
140
    if (!isString(pattern))
140
    if (!isString(pattern))
141
        errorcall(call, _("invalid filename pattern"));
141
        errorcall(call, _("invalid filename pattern"));
142
    if (!isString(tempdir))
142
    if (!isString(tempdir))
143
        errorcall(call, _("invalid tempdir"));
143
        errorcall(call, _("invalid 'tempdir'"));
144
    if (n1 < 1)
144
    if (n1 < 1)
145
	errorcall(call, _("no pattern"));
145
	errorcall(call, _("no 'pattern'"));
146
    if (n2 < 1)
146
    if (n2 < 1)
147
	errorcall(call, _("no tempdir"));
147
	errorcall(call, _("no 'tempdir'"));
148
    slen = (n1 > n2) ? n1 : n2;
148
    slen = (n1 > n2) ? n1 : n2;
149
    PROTECT(ans = allocVector(STRSXP, slen));
149
    PROTECT(ans = allocVector(STRSXP, slen));
150
    for(i = 0; i < slen; i++) {
150
    for(i = 0; i < slen; i++) {
151
	tn = CHAR( STRING_ELT( pattern , i%n1 ) );
151
	tn = CHAR( STRING_ELT( pattern , i%n1 ) );
152
	td = CHAR( STRING_ELT( tempdir , i%n2 ) );
152
	td = CHAR( STRING_ELT( tempdir , i%n2 ) );