Lines Matching +full:no +full:- +full:output

20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
59 "usage: truncate [-c] -s [+|-|%|/]size[K|k|M|m|G|g|T|t] file ..."
60 _custom_create_file print " truncate [-c] -r rfile file ..."
61 …_custom_create_file print " truncate [-c] -d [-o offset[K|k|M|m|G|g|T|t]] -l length[K|k|M|m|…
72 create_stderr_usage_file 'truncate: illegal option -- 7'
74 # We expect the error message, with no new files.
75 atf_check -s not-exit:0 -e file:stderr.txt truncate -7 -s0 output.txt
76 [ ! -e output.txt ] || atf_fail "output.txt should not exist"
89 # We expect the error message, with no new files.
90 atf_check -s not-exit:0 -e file:stderr.txt truncate -s+1L output.txt
91 [ ! -e output.txt ] || atf_fail "output.txt should not exist"
104 # We expect the error message, with no new files.
105 atf_check -s not-exit:0 -e file:stderr.txt \
106 truncate -s8388608t output.txt
107 [ ! -e output.txt ] || atf_fail "output.txt should not exist"
113 atf_set "descr" "Verifies that -c prevents creation of new files"
117 # No new files and truncate returns 0 as if this is a success.
118 atf_check truncate -c -s 0 doesnotexist.txt
119 [ ! -e output.txt ] || atf_fail "doesnotexist.txt should not exist"
121 atf_check truncate -c -r reference doesnotexist.txt
122 [ ! -e output.txt ] || atf_fail "doesnotexist.txt should not exist"
128 atf_check -e file:stderr.txt truncate -c -s1 exists.txt
129 [ -s exists.txt ] || atf_fail "exists.txt be larger than zero bytes"
136 "-s and -r cannot be specifed together"
142 # Force an error due to the use of both -s and -r.
144 atf_check -s not-exit:0 -e file:stderr.txt truncate -s0 -r afile afile
158 atf_check -s not-exit:0 -e file:stderr.txt truncate -s1
164 atf_set "descr" "Verifies that truncate detects a non-existent" \
169 create_stderr_file "truncate: afile: No such file or directory"
172 atf_check -s not-exit:0 -e file:stderr.txt truncate -r afile afile
173 [ ! -e afile ] || atf_fail "afile should not exist"
187 # Trying to get the ftruncate() call to return -1.
191 atf_check -s not-exit:0 -e file:stderr.txt truncate -s1 exists.txt
204 atf_check -s exit:0 -e file:stderr.txt truncate -s1k output.txt
205 atf_check -s exit:1 cmp -s output.txt /dev/zero
206 eval $(stat -s output.txt)
207 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
212 atf_check -s exit:0 -e file:stderr.txt truncate -c -s1M output.txt
213 atf_check -s exit:1 cmp -s output.txt /dev/zero
214 eval $(stat -s output.txt)
215 [ ${st_size} -eq 1048576 ] || atf_fail "expected file size of 1m"
229 atf_check -s exit:0 -e file:stderr.txt truncate -s1M output.txt
230 atf_check -s exit:1 cmp -s output.txt /dev/zero
231 eval $(stat -s output.txt)
232 [ ${st_size} -eq 1048576 ] || atf_fail "expected file size of 1m"
237 atf_check -s exit:0 -e file:stderr.txt truncate -s1k output.txt
238 atf_check -s exit:1 cmp -s output.txt /dev/zero
239 eval $(stat -s output.txt)
240 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
254 atf_check -s exit:0 -e file:stderr.txt truncate -s+1k output.txt
255 atf_check -s exit:1 cmp -s output.txt /dev/zero
256 eval $(stat -s output.txt)
257 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
262 atf_check -s exit:0 -e file:stderr.txt truncate -s+1047552 output.txt
263 atf_check -s exit:1 cmp -s output.txt /dev/zero
264 eval $(stat -s output.txt)
265 [ ${st_size} -eq 1048576 ] || atf_fail "expected file size of 1m"
279 atf_check -s exit:0 -e file:stderr.txt truncate -s+1049600 output.txt
280 atf_check -s exit:1 cmp -s output.txt /dev/zero
281 eval $(stat -s output.txt)
282 [ ${st_size} -eq 1049600 ] || atf_fail "expected file size of 1m"
287 atf_check -s exit:0 -e file:stderr.txt truncate -s-1M output.txt
288 atf_check -s exit:1 cmp -s output.txt /dev/zero
289 eval $(stat -s output.txt)
290 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
302 # Create three files -- the middle file cannot allow writes.
311 atf_check -s not-exit:0 -e file:stderr.txt \
312 truncate -c -s1k before 0000 after
313 eval $(stat -s before)
314 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
315 eval $(stat -s after)
316 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
317 eval $(stat -s 0000)
318 [ ${st_size} -eq 0 ] || atf_fail "expected file size of zero"
330 eval $(stat -s reference)
331 [ ${st_size} -eq 4 ] || atf_fail "reference file should be 4 bytes"
336 atf_check -e file:stderr.txt truncate -r reference afile
337 eval $(stat -s afile)
338 [ ${st_size} -eq 4 ] || atf_fail "new file should also be 4 bytes"
351 atf_check -s exit:0 -e file:stderr.txt truncate -s0 output.txt
352 eval $(stat -s output.txt)
353 [ ${st_size} -eq 0 ] || atf_fail "expected file size of zero"
356 atf_check -s exit:0 -e file:stderr.txt truncate -s+0 output.txt
357 eval $(stat -s output.txt)
358 [ ${st_size} -eq 0 ] || atf_fail "expected file size of zero"
370 eval $(stat -s afile)
371 [ ${st_size} -eq 5 ] || atf_fail "afile file should be 5 bytes"
376 atf_check -e file:stderr.txt truncate -s-100 afile
377 eval $(stat -s afile)
378 [ ${st_size} -eq 0 ] || atf_fail "new file should now be zero bytes"
390 eval $(stat -s afile)
391 [ ${st_size} -eq 5 ] || atf_fail "afile file should be 5 bytes"
396 atf_check -e file:stderr.txt truncate -s%100 afile
397 eval $(stat -s afile)
398 [ ${st_size} -eq 100 ] || atf_fail "new file should now be 100 bytes"
410 eval $(stat -s afile)
411 [ ${st_size} -eq 5 ] || atf_fail "afile file should be 5 bytes"
416 atf_check -e file:stderr.txt truncate -s/2 afile
417 eval $(stat -s afile)
418 [ ${st_size} -eq 4 ] || atf_fail "new file should now be 4 bytes"
430 eval $(stat -s afile)
431 [ ${st_size} -eq 5 ] || atf_fail "afile file should be 5 bytes"
436 atf_check -e file:stderr.txt truncate -s/10 afile
437 eval $(stat -s afile)
438 [ ${st_size} -eq 0 ] || atf_fail "new file should now be 0 bytes"