FreeCalypso > hg > freecalypso-tools
diff rvinterf/etmsync/fileio.c @ 595:e6fe9d25377a
fc-fsio: rm-subtree command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 04 Feb 2020 05:30:59 +0000 |
parents | a0754c98fc2b |
children | 74d284add54d |
line wrap: on
line diff
--- a/rvinterf/etmsync/fileio.c Tue Feb 04 05:09:13 2020 +0000 +++ b/rvinterf/etmsync/fileio.c Tue Feb 04 05:30:59 2020 +0000 @@ -357,6 +357,56 @@ return(0); } +do_xlstat_notfoundok(pathname, found, result) + char *pathname; + int *found; + struct stat_info *result; +{ + u_char cmdpkt[MAX_PKT_TO_TARGET], *dp; + int rc, slen; + + slen = strlen(pathname); + if (slen >= TMFFS_STRING_SIZE) { + printf("error: pathname arg exceeds string length limit\n"); + return(ERROR_USAGE); + } + dp = cmdpkt + 1; + *dp++ = ETM_FFS2; + *dp++ = TMFFS_XLSTAT; + *dp++ = slen + 1; + strcpy(dp, pathname); + dp += slen + 1; + rc = etm_pkt_exch(cmdpkt, dp - cmdpkt - 1); + if (rc) + return(rc); + if (rvi_msg[3] == TMFFS_ERR_NOTFOUND) { + *found = 0; + return(0); + } + if (rvi_msg[3]) { + report_ffs_err("xlstat", rvi_msg[3]); + return(ERROR_TARGET); + } + if (rvi_msg_len != 30 || rvi_msg[4] != 24) { + printf("error: xlstat response has wrong length\n"); + return(ERROR_TARGET); + } + *found = 1; + result->type = rvi_msg[5]; + result->flags = rvi_msg[6]; + result->inode = rvi_msg[7] | rvi_msg[8] << 8; + result->size = rvi_msg[9] | rvi_msg[10] << 8 | rvi_msg[11] << 16 | + rvi_msg[12] << 24; + result->space = rvi_msg[13] | rvi_msg[14] << 8 | rvi_msg[15] << 16 | + rvi_msg[16] << 24; + result->location = rvi_msg[17] | rvi_msg[18] << 8 | rvi_msg[19] << 16 | + rvi_msg[20] << 24; + result->block = rvi_msg[22]; + result->sequence = rvi_msg[23] | rvi_msg[24] << 8; + result->updates = rvi_msg[25] | rvi_msg[26] << 8; + return(0); +} + do_mkdir_existok(pathname) char *pathname; {