• 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
Re: creating temp files??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating temp files??


  • Subject: Re: creating temp files??
  • From: Andrew Oliver <email@hidden>
  • Date: Wed, 11 Jun 2003 22:46:03 -0700

Actually, Paul, I am correct, if you follow the entire code.

I build tempFilename as a string and only a string. As the variable name
implies it is the name of the tempfile, not the tempfile itself.

The difference with your code is you convert the "path to temporary items"
to a string in line one, whereas I convert the pathname to a string when I
concatenate the filename to it in line 2.

Me:

set tempDir to path to temporary items
set tempFilename to tempDir & "tempfile2" as string
--> "Macintosh HD:private:tmp:501:Temporary Items:tempfile2"

You:

set tempDir to path to temporary items as string
set tempFilename to tempDir & "tempfile"
--> "Macintosh HD:private:tmp:501:Temporary Items:tempfile2"

Either code works. I can't see that it makes one iota of difference either
way, except that I still stand by my code. :)

Andrew
:)

On 6/11/03 9:03 PM, "Paul Berkowitz" <email@hidden> wrote:

> On 6/11/03 8:48 PM, "Andrew Oliver" <email@hidden> wrote:
>
>> To be doubly safe, you can use the 'path to' command to find the system temp
>> directory (not necessarily /var/tmp :
>>
>> set tempDir to path to temporary items
>> set tempFilename to tempDir & "myFilename" as string
>
> Not so good. That's concatenating an alias to a string, making a list, then
> (hopefully) coercing the list to a string. Omit coercions:
>
> set tempDir to path to temporary items as string -- or 'as Unicode text'
> set tempFilename to tempDir & "myFilename"
>
>> set fileRef to open for access file tempFilename ... blah blah blah...
_______________________________________________
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: creating temp files??
      • From: John Delacour <email@hidden>
    • Re: creating temp files??
      • From: Paul Berkowitz <email@hidden>
    • Re: creating temp files??
      • From: Shane Stanley <email@hidden>
References: 
 >Re: creating temp files?? (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: creating temp files??
  • Next by Date: Re: creating temp files??
  • Previous by thread: Re: creating temp files??
  • Next by thread: Re: creating temp files??
  • Index(es):
    • Date
    • Thread