What is the secret?

I need to ask again as the original question found its way to page two and will remain unanswered :frowning: Any help at all would be greatly appreciated. If the question is unclear please ask me to clarify.

The problem is this. I have a document with an HTML attachment. Also attached are the graphics files for the html.

When a user double clicks the document in a view, I have it set to open the attachment. This works no problem, browser opens html displays… no graphics. So in Notes 5, code was written to detach the graphic files to the same temp directory where notes 5 extract the html for viewing. This was easy because notes 5 temp directory was simply a dot formatted directory name of the clients data directory (e.g. temp\c.notes.data)

Now the problem is that Notes 6 uses a different naming strategy for the temp directory, and it seems to be different on different machines. My macine has ‘temp\notes6030C8’

What I need to know is, how does notes 6 decide what the name of its temp directory is ?

Subject: What is the secret ?

I replied to your original question. Using a Notes client to look at unread questions in chronological order, I have only now seen this duplicate.

Subject: RE: What is the secret ?

Thanks for answering.The post by Rod from the duplicate thread →

Perhaps you can work around it by checking all the directories with names like temp\notes??? and picking the one that contains the most recent .reg file. ←

this was the idea i am toying with as it seems to be the only solution.

My colleague was browing the notes6 C API and discovered in the osenv.h some constants relating to the temp directory name :

TEMP_DIR_PREFIX

TEMP_DIR_SUFFIX_LEN

TEMP_DIR_SUFFIX_FORMATSPEC

TEMP_DIR_DEFAULT_SUFFIX

TEMP_DIR_SUFFIX_MAX_VALUE

These have default values respectivly:

notes

6

%06x

G00000

0x00ffffff

What we could not find in the api was a funtion to get or set the actual temp directory name.

Surely there must be a function somewhere that notes uses to create the directory in the first place, plus it must store this knowledge somewhere so that it can refer back to the temp directory it created earlier.

I’m sure there are answers to this, but in the meantime I’m gonna have to make do with ‘notes???’ search stuff :frowning:

Thanks Rod.

Subject: RE: What is the secret ?

You are right, there is:

Const wAPIModule = "NNOTES"  ' Windows/32

Declare Function OSGetSystemTempDirectory Lib wAPIModule Alias "OSGetSystemTempDirectory" _
(  Byval S As String) As Integer


Function TempDirectory() As String
     d$ = Space(256)
     s% = OSGetSystemTempDirectory(d$)
     TempDirectory = Left$(d$, s%)
End Function

Subject: RE: What is the secret ?

Thanks Rod!, Exactly what I needed. Can I ask where you got this information ?

Subject: RE: What is the secret ?

Hacking, prompted by what your colleague found. I searched the exported functions in nnotes.dll for “tempdir”. Then I was prepared to use trial and error to find the parameters. As it happens, the first thing I tried worked, It was a pleasant surprise to find that it returns the length.

Subject: RE: What is the secret ?

O.k., thanks for your time and effort. You gotta love all these undocumented treasures we can dig up.