aboutsummaryrefslogtreecommitdiff
path: root/tests/maxlen.bash
blob: f009df2f7715f145403e28c79d0d7ede99df0bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash -eu
#
# Find out the maximum supported filename length and print it.
#
# Part of the gocryptfs test suite
# https://nuetzlich.net/gocryptfs/

NAME="maxlen."
LEN=7

while [ $LEN -le 10000 ]; do
	touch $NAME 2> /dev/null || break
	rm $NAME
	NAME="${NAME}x"
	let LEN=LEN+1
done

echo $LEN