Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'set eof' command broken in Tiger?



Title: 'set eof' command broken in Tiger?
Hello All,

Has anyone ran into problems w/ setting the eof of a file after writing to it in AS?  The following code below demonstrates my problem... (wf_content is a string that contains carriage-return-delimited [ascii 13] lines of data)


    
-- The do shell output works
   do shell script "echo " & wf_content & " > ~/Desktop/wf_output.txt"
    do shell script "echo " & pars_content & " > ~/Desktop/pars_output.txt"
                            
    -- But opening the file, writing to it and setting eof doesn't
   set wf_eof to number of characters in wf_content
   set wf_file to open for access wf_path with write permission
   write wf_content to wf_file
   set eof wf_file to wf_eof
   close access wf_file
                           

The problem is that the  file that I open and write to (wf_file) only contain about 50% of the data that I actually write to it.  However, the “do shell script” output file works the way it’s supposed to (it contains all the data it’s supposed to).  If I view the wf_file output file in TextWrangler, it contains the SAME number characters as the working “do shell script” output file, although it only has about half the lines.  If I “zap the gremlins” in TextWrangler, the characture count gets cut into about half (which sounds more accurate).  If I remove the “set eof” command, and just write to a new file, the wf_file output looks great.

I’ve debugged the heck out of the script, watching all variables and strings, and everything is kosher up to the file writings.  Am I doing something wrong here?  The app I wrote worked perfectly fine in 10.3.9.  We then upgraded out workstations to 10.4.4 and now it broke.  I searched around and didn’t see anyone else with this problem.


Thanks!

Josh Lezniak
Systems Programmer | DFP Support
email@hidden
612.727.4359

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.