TextOutputStream IOExeption…

Current versions…

How is it possible ?

What can I do ?

PS: worked fine with Xojo 2021r2.1 (AND PRIOR VERSIONS)

Whats the question?
Whats the error?

If the path is bad, or read-only, you will get an exception.
Is this a syntax error, or ‘break on exception’?

What is gSave_FI defined as?
Using e as IOException always strikes me as a bad idea, because it doesn’t trap other exceptions

The code is based on what I found in the LR.

The code is meant to trap IOExceptions, but crash on the Try part.

Error ? Is there’s an error ? All I can see is this ÈÏÈÏß∫Î red circle with a white x inside. and the debugger:

gSave_FI is a text file (it exists) and is defined some lines above:

gDocs_FI = SpecialFolder.Documents

gSave_FI = gDocs_FI.Child(Save_Name)

Save name holds a valid file name with a .txt extension.

Nothing fancy, and it works fine under Xojo 21.r2.1 (and 2015r1) actually running in the MR1 MacBook Pro / Monterey…

After getting the IOException, I searched and get the file in the Documents folder (where I intended to place it).

That “stoned” me… and why the reason why I asked.

have you looked at the exception message? something useful there?
have you clicked at IOException in debugger?

No. It says Error 35.

Of course, Error 35 !

No, no message.

All of a sudden, I have a crazy idea: since this project is already running, this file is already open in the other Xojo version/project.

what happen if you edit/save/del it with a text editor?
or after reboot

Is the right answer.
And so it is the correct exception?

I do not know, there was irony (above) when I reported the Error # (35). In the LR, I do not saw any list of Error #s

I am working with the project (running in the 21r2.1 IDE) and do not want to quit (unles a crash), so to give an answer, I fired Xojo 3.1, then asked myself “Is my current project running in this version” … and here we are.

Kudos to all.

BTW: this code seems to be a preparation to something else I do not completely implemented by lack of time. (a debug log in text file)

Open, Write your line, close it immediately.
or do the same in a database

Note that such a log will grow over time, and may need to be trimmed now and then.
Unless you create a ‘log per month’ which will stop growing once the month end passes.

For a log file, much the best way.

And I have a housekeeping thread in the app which runs once an hour. Once a week it checks to see if the log file needs rotating (based on size exceeding 512kB). If so it renames and zips the current one and keeps up to 10 most recent such files.

Thanks for the tips.

It was not that kind of log.

I load a lot of folders, manipulate their names, search data in their contents, etc. then I generate an html file.

As far as I can tell, it was a log to follow how I follow the folders, their contents and construct the html file in a TextArea (in a Table of Contents form) where I can render it in a HTLMLViewer / Save to disk / Search text data in, etc.

Getting interrupted is a good thing, sometimes, because when I resume that day, I fixed the “then” troubles and do not need the Log anymore. (I think).

Are you sure it’s 35 and not -35?

-35 would be “no such volume”, so maybe your volume went offline between the operations.
35 could mean one among 5 explanations, one being “Resource temporarily unavailable”. That’d be harder to guess…

  • or + 35 ?

I do not know.

Where do you get the explanation ?

-35 would be “no such volume”, so maybe your volume went offline between the operations.
It coul be so if I reject the asked permission access, but it was not the case.