Lines Matching full:file

44 # Helper function that create the file stderr.txt that contains the string
52 # Helper function that create the file stderr.txt that contains the expected
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 …le print " truncate [-c] -d [-o offset[K|k|M|m|G|g|T|t]] -l length[K|k|M|m|G|g|T|t] file ..."
75 atf_check -s not-exit:0 -e file:stderr.txt truncate -7 -s0 output.txt
90 atf_check -s not-exit:0 -e file:stderr.txt truncate -s+1L output.txt
105 atf_check -s not-exit:0 -e file:stderr.txt \
126 # The existing file will be altered by truncate.
128 atf_check -e file:stderr.txt truncate -c -s1 exists.txt
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
165 "reference file"
169 create_stderr_file "truncate: afile: No such file or directory"
171 # The reference file must exist before you try to use it.
172 atf_check -s not-exit:0 -e file:stderr.txt truncate -r afile afile
191 atf_check -s not-exit:0 -e file:stderr.txt truncate -s1 exists.txt
197 atf_set "descr" "Verifies truncate can make and grow a new 1m file"
203 # Create a new file and grow it to 1024 bytes.
204 atf_check -s exit:0 -e file:stderr.txt truncate -s1k output.txt
207 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
211 # Grow the existing file to 1M. We are using absolute sizes.
212 atf_check -s exit:0 -e file:stderr.txt truncate -c -s1M output.txt
215 [ ${st_size} -eq 1048576 ] || atf_fail "expected file size of 1m"
222 "shrink a new 1m file"
228 # Create a new file and grow it to 1048576 bytes.
229 atf_check -s exit:0 -e file:stderr.txt truncate -s1M output.txt
232 [ ${st_size} -eq 1048576 ] || atf_fail "expected file size of 1m"
236 # Shrink the existing file to 1k. We are using absolute sizes.
237 atf_check -s exit:0 -e file:stderr.txt truncate -s1k output.txt
240 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
246 atf_set "descr" "Verifies truncate can make and grow a new 1m file" \
253 # Create a new file and grow it to 1024 bytes.
254 atf_check -s exit:0 -e file:stderr.txt truncate -s+1k output.txt
257 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
261 # Grow the existing file to 1M. We are using relative sizes.
262 atf_check -s exit:0 -e file:stderr.txt truncate -s+1047552 output.txt
265 [ ${st_size} -eq 1048576 ] || atf_fail "expected file size of 1m"
271 atf_set "descr" "Verifies truncate can make and shrink a new 1m file" \
278 # Create a new file and grow it to 1049600 bytes.
279 atf_check -s exit:0 -e file:stderr.txt truncate -s+1049600 output.txt
282 [ ${st_size} -eq 1049600 ] || atf_fail "expected file size of 1m"
286 # Shrink the existing file to 1k. We are using relative sizes.
287 atf_check -s exit:0 -e file:stderr.txt truncate -s-1M output.txt
290 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
302 # Create three files -- the middle file cannot allow writes.
310 # Create a new file and grow it to 1024 bytes.
311 atf_check -s not-exit:0 -e file:stderr.txt \
314 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
316 [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k"
318 [ ${st_size} -eq 0 ] || atf_fail "expected file size of zero"
324 atf_set "descr" "Verifies that truncate can use a reference file"
328 # Create a 4 byte reference file.
331 [ ${st_size} -eq 4 ] || atf_fail "reference file should be 4 bytes"
335 # Create a new file and grow it to 4 bytes.
336 atf_check -e file:stderr.txt truncate -r reference afile
338 [ ${st_size} -eq 4 ] || atf_fail "new file should also be 4 bytes"
344 atf_set "descr" "Verifies truncate can make and grow zero byte file"
350 # Create a new file and grow it to zero bytes.
351 atf_check -s exit:0 -e file:stderr.txt truncate -s0 output.txt
353 [ ${st_size} -eq 0 ] || atf_fail "expected file size of zero"
355 # Pretend to grow the file.
356 atf_check -s exit:0 -e file:stderr.txt truncate -s+0 output.txt
358 [ ${st_size} -eq 0 ] || atf_fail "expected file size of zero"
368 # Create a 5 byte file.
371 [ ${st_size} -eq 5 ] || atf_fail "afile file should be 5 bytes"
375 # Create a new file and do a 100 byte negative relative shrink.
376 atf_check -e file:stderr.txt truncate -s-100 afile
378 [ ${st_size} -eq 0 ] || atf_fail "new file should now be zero bytes"
388 # Create a 5 byte file.
391 [ ${st_size} -eq 5 ] || atf_fail "afile file should be 5 bytes"
395 # Create a new file and do a 100 byte roundup.
396 atf_check -e file:stderr.txt truncate -s%100 afile
398 [ ${st_size} -eq 100 ] || atf_fail "new file should now be 100 bytes"
408 # Create a 5 byte file.
411 [ ${st_size} -eq 5 ] || atf_fail "afile file should be 5 bytes"
415 # Create a new file and do a 2 byte roundup.
416 atf_check -e file:stderr.txt truncate -s/2 afile
418 [ ${st_size} -eq 4 ] || atf_fail "new file should now be 4 bytes"
428 # Create a 5 byte file.
431 [ ${st_size} -eq 5 ] || atf_fail "afile file should be 5 bytes"
435 # Create a new file and do a 10 byte roundup.
436 atf_check -e file:stderr.txt truncate -s/10 afile
438 [ ${st_size} -eq 0 ] || atf_fail "new file should now be 0 bytes"