• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Reading a file as it fills up by another program
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reading a file as it fills up by another program


  • Subject: Reading a file as it fills up by another program
  • From: Harald E Brandt <email@hidden>
  • Date: Thu, 11 Dec 2003 16:47:26 +0100

How to read a file, record by record, as the file is being filled up by another process? The process that is writing to the file is a "regular" unix background process whose stdout and stderr is redirected to the file - no special locking procedures.

I can't get to grips with that, neither from AppleScript, nor from Perl.

If using 'open for access', EOF will retain its value of 0 until the file is closed, so it won't read the file as it fills up. Is it possible at all to use the standard 'read' to do that?

Neither will repeatedly closing the file to reopen it, in a loop, get anything until the writing process has actually closed the file.

Same thing happens using Perl!

There's got to be some method (it's even suggested in TN2065, although not how to achieve that):

--heb
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Reading a file as it fills up by another program
      • From: Christopher Stone <email@hidden>
    • Re: Reading a file as it fills up by another program
      • From: Walter Ian Kaye <email@hidden>
  • Prev by Date: Re: Folder action query 2: properties
  • Next by Date: Re: Snapshot
  • Previous by thread: Re: Snapshot
  • Next by thread: Re: Reading a file as it fills up by another program
  • Index(es):
    • Date
    • Thread