Skip to contentSkip to conversation

Change all occurrences of stat --format and stat --printf to stat -c.

PATCH New Ari Sundholm 1 participant 1 message Sep 22, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 Change all occurrences of stat --format and stat --printf to stat -c.

From: Ari Sundholm <[email protected]>

---
 tests/generic/003 | 2 +-
 tests/generic/192 | 2 +-
 tests/generic/215 | 8 ++++----
 tests/generic/286 | 8 ++++----
 tests/xfs/195     | 2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)
tests/generic/003 +1 -1
index 5c2d383..83d6f90 100755
@@ -52,7 +52,7 @@ _require_relatime
 rm -f $seqres.full
 
 _stat() {
-	stat --printf="%x;%y;%z" $1
+	stat -c "%x;%y;%z" $1
 }
 
 _compare_stat_times() {
tests/generic/192 +1 -1
index f630be9..b2da358 100755
@@ -35,7 +35,7 @@ trap "exit \$status" 0 1 2 3 15
 
 _access_time()
 {
-	stat --format=%X $1
+	stat -c %X $1
 }
 
 is_noatime_set() {
tests/generic/215 +4 -4
index 6ddd1fc..80df55d 100755
@@ -53,8 +53,8 @@ echo
 echo "creating test file"
 dd if=/dev/zero of=$testfile count=4096
 
-mtime1=`stat --printf="%Y" $testfile`
-ctime1=`stat --printf="%Z" $testfile`
+mtime1=`stat -c "%Y" $testfile`
+ctime1=`stat -c "%Z" $testfile`
 
 sleep 2
 
@@ -65,8 +65,8 @@ $XFS_IO_PROG -f 		\
 	-c 'mwrite 0 4096'	\
 	$testfile | _filter_xfs_io_unique
 
-mtime2=`stat --printf="%Y" $testfile`
-ctime2=`stat --printf="%Z" $testfile`
+mtime2=`stat -c "%Y" $testfile`
+ctime2=`stat -c "%Z" $testfile`
 
 let mtime_diff=$mtime2-$mtime1
 let ctime_diff=$ctime2-$ctime1
tests/generic/286 +4 -4
index 94c22c6..f6bf356 100755
@@ -73,7 +73,7 @@ test01()
 
 	$here/src/seek_copy_test $src $dest
 	
-	test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+	test $(stat -c "%s" $src) = $(stat -c "%s" $dest) ||
 		_fail "TEST01: file size check failed"
 
 	cmp $src $dest || _fail "TEST01: file bytes check failed"
@@ -101,7 +101,7 @@ test02()
 
 	$here/src/seek_copy_test $src $dest
 
-	test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+	test $(stat -c "%s" $src) = $(stat -c "%s" $dest) ||
 		_fail "TEST02: file size check failed"
 
 	cmp $src $dest || _fail "TEST02: file bytes check failed"
@@ -143,7 +143,7 @@ test03()
 	echo >>$seqres.full
 	$here/src/seek_copy_test $src $dest
 
-	test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+	test $(stat -c "%s" $src) = $(stat -c "%s" $dest) ||
 		_fail "TEST03: file size check failed"
 
 	cmp $src $dest || _fail "TEST03: file bytes check failed"
@@ -185,7 +185,7 @@ test04()
 	echo >>$seqres.full
 	$here/src/seek_copy_test $src $dest
 
-	test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) ||
+	test $(stat -c "%s" $src) = $(stat -c "%s" $dest) ||
 		_fail "TEST04: file size check failed"
 
 	cmp $src $dest || _fail "TEST04: file bytes check failed"
tests/xfs/195 +1 -1
index 6abddbc..c7bc7b8 100755
@@ -69,7 +69,7 @@ _require_user
 echo "Preparing subtree"
 mkdir $TEST_DIR/d
 touch $TEST_DIR/d/t
-inum=`stat --format "%i" $TEST_DIR/d/t`
+inum=`stat -c "%i" $TEST_DIR/d/t`
 
 echo "No dump exclude flag set (should not be skipped)"
 _do_dump
Signature · 1 line
2.1.0