-
#!/usr/bin/perl
-
-
use Fcntl;
-
-
print "enter the SIZE of a file \n";
-
$file=<STDIN>;
-
-
print "enter the location of a file \n";
-
$loc= <STDIN>;
-
chomp($loc);
-
-
sysopen( FILEIN, $loc ,O_CREAT|O_WRONLY);
-
print FILEIN "hai how r u \n";
-
close(FILEIN);
-
#In this perl program, im getting the size(1Mb) and location of a file( C:\) from the user. when compiling this
program, the file is saved properly under the location user wants ( C:\) but How to
create a file with the size(1mb) user wants??