diff --git a/apps/EchoClient.cpp b/apps/EchoClient.cpp
index 4b27e78beb50aeb4da5bcef99a7853a9247b8619..28fe707daff38a693f5d0b759bc4fdc70b7c71b7 100644
--- a/apps/EchoClient.cpp
+++ b/apps/EchoClient.cpp
@@ -212,15 +212,7 @@ auto main(int argc, char* argv[]) -> int {
 	}
 
 	int out_fd = STDOUT_FILENO;
-
 	char* output_file = getOption(argc, argv, "-f");
-	if (output_file) {
-		out_fd = open(output_file, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
-
-		if (out_fd < 0) {
-			DIE_MSG_ERRNO("opening output file failed");
-		}
-	}
 
 	int err = getaddrinfo(host.c_str(), port.c_str(), nullptr, &server);
 	if (err) {
@@ -281,7 +273,26 @@ auto main(int argc, char* argv[]) -> int {
 		auto total_duration = duration_cast<nanoseconds>(echo_end - connect_start).count();
 
 		std::stringstream sst;
-		sst << "clients,iterations,size,avg_ns,connect,echo,total" << std::endl;
+		bool exists = true;
+		if (output_file) {
+			exists = access(output_file, W_OK) == 0;
+			int openflags;
+			int mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH;
+			if (!exists) {
+				openflags = O_CREAT | O_WRONLY;
+			} else {
+				openflags = O_APPEND;
+			}
+
+			out_fd = emper::io::openAndWait(output_file, openflags, mode);
+			if (out_fd < 0) {
+				DIE_MSG_ERRNO("opening output file failed");
+			}
+		}
+
+		if (!exists) {
+			sst << "clients,iterations,size,avg_ns,connect,echo,total" << std::endl;
+		}
 		sst << clients << "," << iterations << "," << size << "," << avg_ns << "," << connect_duration
 				<< "," << echo_duration << "," << total_duration << std::endl;