LB Booster
« Re: [RC] Unix/ls »

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!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Re: [RC] Unix/ls  (Read 913 times)
tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: [RC] Unix/ls
« Reply #11 on: Oct 27th, 2016, 2:19pm »

Quote:
The first is when the program is executed in DOS, or by a DOS .BAT file, and the current directory is different than the directory where the .exe file resides. In this case, StartupDir$ is set to the current directory at the time the program is executed. This procedure is not, however, normally done by the user of a program
About
>> This procedure is not, however, normally done by the user of a program
I really read task as "recreate UNIX ls" which is program executed from a command line.
Really, command line still has its uses.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: [RC] Unix/ls
« Reply #12 on: Oct 27th, 2016, 3:49pm »

on Oct 27th, 2016, 2:19pm, tsh73 wrote:
I really read task as "recreate UNIX ls" which is program executed from a command line.

Of course in LBB you can create a console application and make it look exactly like ls or dir. In LB 4 the best you can do is to display the output in a window; it's not clear from the task description at RC whether that qualifies as a solution or not.

Richard.
User IP Logged

Jack Kelly
Full Member
ImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 106
xx 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?

on Oct 25th, 2016, 11:16am, Jack Kelly wrote:
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.


Thanks,
Jack
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: [RC] Unix/ls
« Reply #14 on: Feb 7th, 2017, 1:53pm »

on Feb 7th, 2017, 06:55am, Jack Kelly wrote:
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.

Richard.
« Last Edit: Feb 7th, 2017, 3:47pm by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »


This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls