Temp files in os X? 
Author Message
 Temp files in os X?

Here's the beginning of a method of one of my classes

  dim bsOriginal, bsHeaderPortion, bsStringsPortion,bsFinal as
binaryStream
  dim fiHeaderTemp,fiStrTemp as folderItem
  dim i,iEndloop as integer
  dim
iWrittenEntries,iHold,iCacheSize,iToWrite,iNumberOfEntries,iWrittenStrOf
fset as integer
  dim
iStrLen,iOffset,iOffsetToStr,iOffsetCorrection,iReplacedEntryStrLen as
integer
  dim sJunk as string
  dim bChangeOffset as boolean
  if uBound(pcNewEntries)> -1 then
    'initialize the work files
    fiHeaderTemp = TemporaryFolder.Child("IREDlgTempHdr.tlk")
    if fiHeaderTemp.exists then
      fiHeaderTemp.delete
    end if
    bsHeaderPortion = fiHeaderTemp.CreateBinaryFile(fileType)
    bsHeaderPortion.littleEndian = true

and an exception is thrown in that last line??? Hmm the only thing that
might need explaining is that fileType is string arguement passed to
the method.
I used the de{*filter*} and it tells me fiTempHeader exists but isWriteable
= false
So from this i deduce that it must be some problem with the permissions
in os x so what do i do when i need to write tempfiles in os x? Any
hints? Or something obvious i'm missing?
-Dev

--



Tue, 04 Jan 2005 23:46:19 GMT  
 Temp files in os X?

the plot thickens... so i figured out that is was because bsHeaderTemp
was nil... so i fixed those problems by using GetTemporaryfolderItem
and all worked well

Then the problem reoccurs when i do the
bsFinal = file.CreateBinaryFile(fileType)

File is a folderItem argument passed the method

I check the file and it's iswriteable property is set to false... so i
double checked the privileges on the file and everyone can read and
write so i can't see why it's saying it's not writable :P

Anyone have any comments or suggestions?

--
Visit the premier mac modding community for Infinity Engine games (bg,bg2,iwd),
Balduran's Adventurin' Spa & Grille
http://ire.mainecoon.net
*remove the Not WanteD to email me



Wed, 05 Jan 2005 00:33:27 GMT  
 Temp files in os X?

Quote:

>     fiHeaderTemp = TemporaryFolder.Child("IREDlgTempHdr.tlk")
>     if fiHeaderTemp.exists then
>       fiHeaderTemp.delete
>     end if

If you're running into permissions problems, a better solution might be
to handle this portion of the code differently.  Instead of deleting
the file that's in the way, try choosing a different file name (since
this is a temporary file we're talking about, so its name shouldn't
matter).


Wed, 05 Jan 2005 02:17:56 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. files, temp files, and file-like objects

2. Write to 2 file from pipe without using temp file

3. TEMP=c:\windows\temp

4. os independent temp dir?

5. Temp file names

6. TempRes temp file

7. C5abc Temp files on local machine

8. Temp files from Report

9. delete temp files in CPD2110 app

10. Are Temp Files the Problem!

11. NT Server - creating temp files

12. Create Temp File in C2003

 

 
Powered by phpBB® Forum Software