Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
under linux Program Console BUG
#1
i made a console program ($Console:Only) that should run in a terminal. it seems that when executing a console program, the current directory is the one of the executable. the _CWD$ function confirms it.
Reply
#2
Are you able to change directory? If so what does _CWD$ report then?
b = b + ...
Reply
#3
(05-27-2022, 12:51 AM)bplus Wrote: Are you able to change directory? If so what does _CWD$ report then?

hello, the program must run in a bash script. i put it in a directory listed in the path so that it is accessible. _CWD$ returns at runtime the executable directory instead of the current directory. using chdir to a directory, _CWD$ works. it's very annoying. it looks like a bug.

example :
Code: (Select All)
$Console:Only
Color 14
Print _CWD$
ChDir "..\"
Print _CWD$
Reply
#4
explanation. all console programs are supposed to be located in the current directory. this is not the case for programs generated by qb64. the _CWD$ function simply confirms this anomaly. well. while waiting for a possible correction, I rewrote the program in freebasic.
Reply
#5
(05-29-2022, 10:34 AM)Coolman Wrote: explanation. all console programs are supposed to be located in the current directory. this is not the case for programs generated by qb64. 

Do you mean this:
With a new file, the program folder is always displayed, not the last directory from which a call was made.
This also applies to saving a new file. That is also in Version 2.02 so.

[Image: Startet-im-Programmordner-K.jpg]
Reply
#6
(05-29-2022, 03:22 PM)Kernelpanic Wrote:
(05-29-2022, 10:34 AM)Coolman Wrote: explanation. all console programs are supposed to be located in the current directory. this is not the case for programs generated by qb64. 

Do you mean this:
With a new file, the program folder is always displayed, not the last directory from which a call was made.
This also applies to saving a new file. That is also in Version 2.02 so.

[Image: Startet-im-Programmordner-K.jpg]

hello. i will give a simple example under linux. for example the command ls :

- go to a directory and run ls (bash command to list files and directories)

- the command works in the current directory.

with a qb64 console program, the current directory is the one of the executable. i don't know if it's clear. i use an online translator...
Reply
#7
Quote:- go to a directory and run ls (bash command to list files and directories)

- the command works in the current directory.


The "ls -al" command works even if I specify a different directory; see screenshot.
I am in "~/lab/c" and let me show from there my home directory "~".

But I don't understand the last sentence. I can't really imagine what you mean.
(My comments are also half me, half translator.  Wink  )



[Image: ls-anderes-Verzeichnis2022-05-29.jpg]
Reply
#8
That's correct behavior, _STARTDIR$ contains the original current directory and your can use CHDIR to switch back to it.
Reply
#9
*** That's correct behavior

not really. normally, all console programs point to the current directory automatically...

*** _STARTDIR$ contains the original current directory and your can use CHDIR to switch back to it.

thank you. yes, it solves the problem.
Reply
#10
I agree with that, I meant correct behavior for a QB64 program. I don't know why it does that but it can't be changed at this point.
Reply




Users browsing this thread: 4 Guest(s)