be4311c07e14feb728abc6425ee606ffaa611a58 markd Fri Jan 22 06:46:58 2021 -0800 merge with master diff --git src/lib/osunix.c src/lib/osunix.c index d993cad..bcfa5a2 100644 --- src/lib/osunix.c +++ src/lib/osunix.c @@ -776,15 +776,29 @@ errnoAbort("lstat failure on %s", path); if ((sb.st_mode & S_IFMT) != S_IFLNK) errnoAbort("path %s not a symlink.", path); return mustReadSymlinkExt(path, &sb); } void makeSymLink(char *oldName, char *newName) /* Return a symbolic link from newName to oldName or die trying */ { int err = symlink(oldName, newName); if (err < 0) errnoAbort("Couldn't make symbolic link from %s to %s\n", oldName, newName); } +boolean remoteFileExists(char *remoteLogin, char *file) +/* Check to see if the file exists on the remote machine. */ +{ +char buffer[4096]; + +// rsync might be a better choice, but checking for non-zero is more complicated +//safef(buffer, sizeof buffer, "rsync -qnav qateam@%s:%s /dev/null 2> /dev/null", server, file); +safef(buffer, sizeof buffer, "ssh %s test -s \"%s\"", remoteLogin, file); + +int ret = system(buffer); +if (ret) + return FALSE; +return TRUE; +}