Can somebody show me how to write a program to create a file that contains any thing (characters, etc) and we can define the size of that file? I need a program that can create many files with different sizes.
Thanks.
does it matter what language you want to write it in?
#!/usr/bin/ksh
echo "Enter the number of characters to define the file size"
read CHAR
CHAR=`expr $CHAR / 2`
echo "Enter filename"
read FILE
if [ -e $FILE ]
then echo "File exists, shoud I overwrite?"
read YESNO
if [ $YESNO = "Y" ] || [ $YESNO = "y" ]
then rm -f $FILE
else if [ $YESNO = "N" ] || [ $YESNO = "n" ]
then exit
fi
fi
fi
A=0
until [ $A -eq $CHAR ]
do echo "0" >> $FILE
A=`expr $A + 1`
done
[Edited by 98_1LE on 02-16-2001 at 02:13 PM]