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.
|
under linux Program Console BUG
|
|
05-27-2022, 12:51 AM
Are you able to change directory? If so what does _CWD$ report then?
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
(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
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.
05-29-2022, 03:22 PM
(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.
05-29-2022, 04:54 PM
(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. 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...
05-29-2022, 05:20 PM
Quote:- go to a directory and run ls (bash command to list files and directories) 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. )
05-29-2022, 07:06 PM
That's correct behavior, _STARTDIR$ contains the original current directory and your can use CHDIR to switch back to it.
05-29-2022, 07:28 PM
*** 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.
05-29-2022, 07:32 PM
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.
|
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| Make windows .exe using Linux version? | Circlotron | 7 | 510 |
01-15-2026, 09:42 PM Last Post: ahenry3068 |
|
| Linux Lubuntu INKEY$ issue | TempodiBasic | 7 | 648 |
09-09-2025, 02:53 PM Last Post: hsiangch_ong |
|
| Linux - file dialogue boxes... | atl068 | 7 | 928 |
08-05-2025, 07:21 PM Last Post: hsiangch_ong |
|
| System Linux | Chris | 9 | 1,217 |
07-12-2025, 08:51 PM Last Post: Chris |
|
| Is this a bug with Round or is it just me | BarrySWTP | 10 | 1,248 |
07-07-2025, 08:40 PM Last Post: BarrySWTP |
|
Users browsing this thread: 1 Guest(s)


![[Image: Startet-im-Programmordner-K.jpg]](https://i.ibb.co/7CR9Vfd/Startet-im-Programmordner-K.jpg)
)![[Image: ls-anderes-Verzeichnis2022-05-29.jpg]](https://i.ibb.co/CVdFVW7/ls-anderes-Verzeichnis2022-05-29.jpg)