• 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
Big numbers (again) and complex routine
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Big numbers (again) and complex routine


  • Subject: Big numbers (again) and complex routine
  • From: julifos <email@hidden>
  • Date: Fri, 07 Mar 2003 12:16:12 +0100

Hi!

I must work with big amounts of data, and I'm having some problems with
read-dowhatever routine:

file_ref is file opened for access
"starting_at" uses to be 1
The problem is with fEoF (eof of file opened for access). If we are talking
about a 800MB file, it will throw an error "can't make fEoF into an
integer".

###########################
repeat with x from starting_at to fEoF by 20000
try
set z to (read file_ref for 20000 from x)
--> do whatever
on error
set z to (read file_ref from x to fEoF)
--> do whatever
exit repeat
end try
end repeat
###########################

So I thought I could make several chunks able to be considered as integers
for large files:

###########################
set times_ to 0
if class of feof is not integer then
set times_ to 100
set div_ to feof div 100 as integer --> eg, 7854421
set mod_ to feof mod 100 as integer --> eg, 69
end if

set start_at_temp to starting_at

repeat with factor_ from 1 to times_
set stop_at to div_ * factor_
if factor_ = times_ then set stop_at to stop_at + mod_

repeat with x from start_at_temp to stop_at by 20000
try
set z to (read file_ref for 20000 from x)
--> do whatever
on error
set z to (read file_ref from x to stop_at)
--> do whatever
exit repeat
end try
end repeat

set start_at_temp to start_at_temp + stop_at
end repeat
###########################

I've tried this and other variations but I keep getting errors, errors,
errors...

Help!

JJ
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
_______________________________________________
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: Big numbers (again) and complex routine
      • From: Emmanuel <email@hidden>
    • Re: Big numbers (again) and complex routine
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Rename File Script newbie question
  • Next by Date: AppleScript to CleanDesktop for 10.2.4 Clients?
  • Previous by thread: Re: Printing PS in Xpress
  • Next by thread: Re: Big numbers (again) and complex routine
  • Index(es):
    • Date
    • Thread