File: maxlen.bash

package info (click to toggle)
gocryptfs 1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,712 kB
  • ctags: 659
  • sloc: sh: 361; makefile: 19
file content (18 lines) | stat: -rwxr-xr-x 297 bytes parent folder | download | duplicates (3)
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=0

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

echo $LEN