Welcome Guest. Please Login or Register. Apr 1st, 2018, 05:01am
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. We apologize Conforums does not have any export functions to migrate data. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
Re: [RC] Unix/ls
« Reply #13 on: Feb 7th, 2017, 06:55am »
Ah, ha. That explains my confusion, Richard. A while back I mentioned that when I start LBB, DefaultDir$ is set to my Windows 'Temp' directory. Anatoly thought that was because LBB referenced that directory during its initilization. Is there any way I can make LBB set DefaultDir$ to the directory where I started it?
I've been looking with some confusion at Anatoly's trials and tribulations over directories. I'm running XP (still...). When I start LBB and run 'print DefaultDir$' I get
Code:
C:\DOCUME~1\Jack\LOKALE~1\Temp
Where does this come from? I was never aware of such a 'Temp' directory, much less ever having used it. But it has never presented any problem to my knowledge.
Is there any way I can make LBB set DefaultDir$ to the directory where I started it?
I don't think so, but there's a good reason. When you run an unsaved BASIC program, LBB has to store a temporary copy of it somewhere because it's run in a separate process. The temporary directory is pretty much the only place in the entire Windows filing system that is guaranteed to exist and guaranteed to be writable.
If LBB were instead to attempt to set DefaultDir$ to your startup directory, that's where it would have to put the temporary copy of your unsaved program. There's no certainly that it could save anything there (for example it might be a directory under C:\Program Files (x86)\ which are non-writable without admin privileges) nor that it should.
So LBB takes a safe course. If you haven't saved your program, so you haven't explicitly said "here is a directory that I am happy for you to store files in" it uses the one place that it definitely can: the temporary directory.
When you run a program from the LB 4 IDE I think it runs 'in process' and does not need to be saved somewhere temporarily (BBC BASIC for Windows works that way too). But LBB does need to save it first.