Lines Matching refs:file
105 char file[128];
111 snprintf(file, sizeof(file), "t1.%06d.%03d", getpid(), i);
112 if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
114 err(1, "open(%s)", file);
116 if (unlink(file) == -1)
117 err(1, "unlink(%s)", file);
127 char file[128];
133 snprintf(file, sizeof(file), "t2.%06d.%03d", getpid(), i);
134 if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
136 err(1, "open(%s)", file);
141 snprintf(file, sizeof(file), "t2.%06d.%03d", getpid(), i);
142 if (unlink(file) == -1)
143 err(1, "unlink(%s)", file);
152 char dir[128], file[128];
161 snprintf(file, sizeof(file), "%s/t3.%06d.%03d", dir,
163 if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
165 err(1, "open(%s)", file);
167 if (unlink(file) == -1)
168 err(1, "unlink(%s)", file);
181 char file[128], new[128];
187 snprintf(file, sizeof(file), "t4.%06d.%03d", getpid(), i);
188 if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
190 err(1, "open(%s)", file);
193 if (rename(file, new) == -1)
194 err(1, "rename(%s, %s)", file, new);
206 char buf[512], file[128];
213 snprintf(file, sizeof(file), "t5.%06d.%03d", getpid(), i);
214 if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
216 err(1, "open(%s)", file);
218 err(1, "write(%s)", file);
220 if (unlink(file) == -1)
221 err(1, "unlink(%s)", file);
231 char buf[512], file[128];
238 snprintf(file, sizeof(file), "t6.%06d.%03d", getpid(), i);
239 if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC,
241 err(1, "open(%s)", file);
243 err(1, "write(%s)", file);
249 snprintf(file, sizeof(file), "t6.%06d.%03d", getpid(), i);
250 if ((fd = open(file, O_RDONLY)) == -1)
251 err(1, "open(%s)", file);
253 err(1, "write(%s)", file);
258 snprintf(file, sizeof(file), "t6.%06d.%03d", getpid(), i);
259 if (unlink(file) == -1)
260 err(1, "unlink(%s)", file);