Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File creation on Windows slows the machine 2

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
Hi,

Running 100MB file cretaion on Windows causes my PC almost to halt:

open(FILE,">$FILE1");
print FILE ' ' x (100 * (1024 * 1024));
close FILE;

Is there any way to ease on the PC when creating such a file ?

Thanks

Long live king Moshiach !
 
Could run it as a seperate process, with a low priority.
see Win32::process.
 
You're creating a 100MB block to write to file, that's gonna hammer your RAM

you could try writing smaller blocks
Code:
open FH, ">myfile.x";
for ($loop=1;$loop <= 1024;$loop++) {
  print FH " " x 1024;
}
close FH;
seems to work fine for me ;-)
HTH

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top