xref: /aosp_15_r20/external/ltp/tools/make-file.sh (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker#!/bin/sh
2*49cdfc7eSAndroid Build Coastguard Worker#
3*49cdfc7eSAndroid Build Coastguard Worker#   Copyright (c) International Business Machines  Corp., 2001
4*49cdfc7eSAndroid Build Coastguard Worker#
5*49cdfc7eSAndroid Build Coastguard Worker#   This program is free software;  you can redistribute it and/or modify
6*49cdfc7eSAndroid Build Coastguard Worker#   it under the terms of the GNU General Public License as published by
7*49cdfc7eSAndroid Build Coastguard Worker#   the Free Software Foundation; either version 2 of the License, or
8*49cdfc7eSAndroid Build Coastguard Worker#   (at your option) any later version.
9*49cdfc7eSAndroid Build Coastguard Worker#
10*49cdfc7eSAndroid Build Coastguard Worker#   This program is distributed in the hope that it will be useful,
11*49cdfc7eSAndroid Build Coastguard Worker#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
12*49cdfc7eSAndroid Build Coastguard Worker#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
13*49cdfc7eSAndroid Build Coastguard Worker#   the GNU General Public License for more details.
14*49cdfc7eSAndroid Build Coastguard Worker#
15*49cdfc7eSAndroid Build Coastguard Worker#   You should have received a copy of the GNU General Public License
16*49cdfc7eSAndroid Build Coastguard Worker#   along with this program;  if not, write to the Free Software
17*49cdfc7eSAndroid Build Coastguard Worker#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*49cdfc7eSAndroid Build Coastguard Worker#
19*49cdfc7eSAndroid Build Coastguard Worker#
20*49cdfc7eSAndroid Build Coastguard Worker#   FILE: generate.sh
21*49cdfc7eSAndroid Build Coastguard Worker#
22*49cdfc7eSAndroid Build Coastguard Worker#   PURPOSE: Creates dat for use in network file transfer tests.
23*49cdfc7eSAndroid Build Coastguard Worker#
24*49cdfc7eSAndroid Build Coastguard Worker#   AUTHOR: Randy Hron ([email protected])
25*49cdfc7eSAndroid Build Coastguard Worker#
26*49cdfc7eSAndroid Build Coastguard Worker############################################################################
27*49cdfc7eSAndroid Build Coastguard Worker
28*49cdfc7eSAndroid Build Coastguard Workerfile=$1
29*49cdfc7eSAndroid Build Coastguard Workersize=$2
30*49cdfc7eSAndroid Build Coastguard Worker
31*49cdfc7eSAndroid Build Coastguard Workerif [ -z "$1" ] || [ -z "$2" ] ; then
32*49cdfc7eSAndroid Build Coastguard Worker	echo "usage: ${0##*/} <file> <size in bytes>"
33*49cdfc7eSAndroid Build Coastguard Worker	exit 1
34*49cdfc7eSAndroid Build Coastguard Workerfi
35*49cdfc7eSAndroid Build Coastguard Worker
36*49cdfc7eSAndroid Build Coastguard Worker[ -e "$file" ] && exit 0
37*49cdfc7eSAndroid Build Coastguard Worker
38*49cdfc7eSAndroid Build Coastguard Workerdd if=/dev/zero bs=1 count="$size" 2>/dev/null | tr "\0" "A" > "$file"
39*49cdfc7eSAndroid Build Coastguard Worker
40*49cdfc7eSAndroid Build Coastguard Workerchmod 666 $file
41