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?
b = b + ...
(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 »
|
Users browsing this thread: 3 Guest(s)