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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. NeilF2

    Sometime PERL only manages to partially write a file? Help!

    i2mc - No you misunderstood... When the file is updated. ie READ records -> update -> WRITE records, it IS locked... (There is a LOCK around the whole procedure) But during this people can READ the data. Under tests the this can result in an empty read. So, this does NOT explain my half...
  2. NeilF2

    Sometime PERL only manages to partially write a file? Help!

    i2mc - I think you're wrong... You say the fact I'm reading the file while others may be writing it could screw it up. I've done a couple of tests this does not seem to be the case. I've got two browser windows. One writing the file (with a sleep statement between each PRINT), and another...
  3. NeilF2

    Sometime PERL only manages to partially write a file? Help!

    I currently DO NOT have "$|=1;" anywhere in my coding...!?!? Should I? Could this be the cause?
  4. NeilF2

    Sometime PERL only manages to partially write a file? Help!

    I've just had a thought... When people update the file I do lock it... But people can view data from the file (ie: not update it) at ANY time. There is NO locking around this reading. If someone is writing to the file (eg: file.txt) using:- open(DF,">file.txt"); foreach $record...
  5. NeilF2

    Sometime PERL only manages to partially write a file? Help!

    I check my OPEN statements for errors, and I lock during all updates using calls to the following subs:- #-------------- # Locking on # Try for 14 secs, else overwrite it - Makes crash proof! #-------------- sub lock_on{ $lock_file=$_[0]; for($i=1;$i<=14;$i++){if(-e $lock_file){sleep...
  6. NeilF2

    Sometime PERL only manages to partially write a file? Help!

    No, I'm simply doing something along the lines of... open(DF,&quot;file.txt&quot;); while($data_line=<DF>){push(@database_rows, $data_line);} close DF; I Adjust the records in DATABASE_ROWS and then... open(DF,&quot;>file.txt&quot;); foreach $record (@database_rows){print DF $record;} close...
  7. NeilF2

    Sometime PERL only manages to partially write a file? Help!

    I have a simple program that basically reads in say 15,000 lines and prints them back out again (eg: &quot;PRINT DF $rec&quot; in a loop)... Over 99% of the time it works an absolute treat, but every now and then it seems to go wrong and only manage to right back a fraction of the records (eg...

Part and Inventory Search

Back
Top