Author Topic: Question about using SHELL "dir" on non windows OS.  (Read 8970 times)

0 Members and 1 Guest are viewing this topic.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #15 on: January 25, 2021, 09:41:17 pm »
Although Steve has provided me a better file select solution, I wanted to go ahead and finish up the SHELL version, so I added the Linux find command if linux OS is detected.   If one of you kind linux people could test this and see if this works for you I'd appreciate it.  Thanks.  I used to have QB64 on linux mint pen drive, but lost it...

Also, this function changes the foreground and background COLOR attributes.  I'd like to restore those upon exiting.  Is there a way to do that?  I'm trying _DEFAULTCOLOR, but it seems to only save foreground (text).  The background color stays changed. (fixed...)

- Dav

Code: QB64: [Select]
  1.  
  2. a$ = FileSelect$(5, 10, 15, 55, "*.*")
  3.  
  4. IF a$ <> "" THEN
  5.     PRINT "You selected: "; a$
  6.  
  7.  
  8.  
  9. FUNCTION FileSelect$ (y, x, y2, x2, Filespec$)
  10.  
  11.     '=== save original place of cursor
  12.     origy = CSRLIN: origx = POS(1)
  13.  
  14.     '=== save colors
  15.     fg& = _DEFAULTCOLOR
  16.     bg& = _BACKGROUNDCOLOR
  17.  
  18.     '=== Save whole screen
  19.     DIM scr1 AS _MEM, scr2 AS _MEM
  20.     scr1 = _MEMIMAGE(0): scr2 = _MEMNEW(scr1.SIZE)
  21.     _MEMCOPY scr1, scr1.OFFSET, scr1.SIZE TO scr2, scr2.OFFSET
  22.  
  23.     loadagain:
  24.  
  25.     top = 0
  26.     selection = 0
  27.  
  28.     IF INSTR(_OS$, "LINUX") THEN
  29.         SHELL _HIDE "find . -type d > $_TeMP_FILE_LIST"
  30.     ELSE
  31.         SHELL _HIDE "dir /b /A:D > $_TeMP_FILE_LIST"
  32.     END IF
  33.  
  34.     'get list...
  35.     REDIM FileNames$(5000) 'space for 5000 filenames
  36.  
  37.     FileNames$(0) = ".."
  38.  
  39.     FF = FREEFILE
  40.     OPEN "$_TeMP_FILE_LIST" FOR INPUT AS #FF
  41.  
  42.     LineCount = 1
  43.     WHILE ((LineCount < UBOUND(FileNames$)) AND (NOT EOF(FF)))
  44.         LINE INPUT #FF, rl$
  45.         FileNames$(LineCount) = "[" + rl$ + "]"
  46.         LineCount = LineCount + 1
  47.     WEND
  48.     CLOSE #FF
  49.  
  50.     KILL "$_TeMP_FILE_LIST"
  51.  
  52.     IF INSTR(_OS$, "LINUX") THEN
  53.         SHELL _HIDE "find . -type f " + CHR$(34) + Filespec$ + CHR$(34) + " > $_TeMP_FILE_LIST"
  54.     ELSE
  55.         SHELL _HIDE "dir /b /A:-D " + Filespec$ + " > $_TeMP_FILE_LIST"
  56.     END IF
  57.  
  58.     FF = FREEFILE
  59.     OPEN "$_TeMP_FILE_LIST" FOR INPUT AS #FF
  60.     WHILE ((LineCount < UBOUND(FileNames$)) AND (NOT EOF(FF)))
  61.         LINE INPUT #FF, rl$
  62.         'skip the temp file...
  63.         IF rl$ <> "$_TeMP_FILE_LIST" THEN
  64.             FileNames$(LineCount) = rl$
  65.             LineCount = LineCount + 1
  66.         END IF
  67.     WEND
  68.     CLOSE #FF
  69.  
  70.     KILL "$_TeMP_FILE_LIST"
  71.  
  72.     'draw a box
  73.     COLOR _RGB(100, 100, 255)
  74.     FOR l = 0 TO y2 + 1
  75.         LOCATE y + l, x: PRINT STRING$(x2 + 4, CHR$(219));
  76.     NEXT
  77.  
  78.     DO
  79.  
  80.         FOR l = 0 TO (y2 - 1)
  81.             LOCATE (y + 1) + l, (x + 2)
  82.             IF l + top = selection THEN
  83.                 COLOR _RGB(0, 0, 0), _RGB(255, 255, 255) 'selected line
  84.             ELSE
  85.                 COLOR _RGB(255, 255, 255), _RGB(0, 0, 0) 'regular
  86.             END IF
  87.             PRINT LEFT$(FileNames$(top + l) + STRING$(x2, " "), x2);
  88.         NEXT
  89.  
  90.         k$ = INKEY$
  91.         SELECT CASE k$
  92.             CASE IS = CHR$(0) + CHR$(72) 'Up arrow
  93.                 IF selection > 0 THEN selection = selection - 1
  94.                 IF selection < top THEN top = selection
  95.             CASE IS = CHR$(0) + CHR$(80) 'Down Arrow
  96.                 IF selection < (LineCount - 1) THEN selection = selection + 1
  97.                 IF selection > (top + (y2 - 2)) THEN top = selection - y2 + 1
  98.             CASE IS = CHR$(0) + CHR$(73) 'Page up
  99.                 top = top - y2
  100.                 selection = selection - y2
  101.                 IF top < 0 THEN top = 0
  102.                 IF selection < 0 THEN selection = 0
  103.             CASE IS = CHR$(0) + CHR$(81) 'Page Down
  104.                 top = top + y2
  105.                 selection = selection + y2
  106.                 IF top >= LineCount - y2 THEN top = LineCount - y2
  107.                 IF top < 0 THEN top = 0
  108.                 IF selection >= LineCount THEN selection = LineCount - 1
  109.             CASE IS = CHR$(0) + CHR$(71) 'Home
  110.                 top = 0: selection = 0
  111.             CASE IS = CHR$(0) + CHR$(79) 'End
  112.                 selection = LineCount - 1
  113.                 top = selection - y2 + 1
  114.                 IF top < 0 THEN top = 0
  115.             CASE IS = CHR$(27) ' ESC cancels
  116.                 FileSelect$ = ""
  117.                 EXIT DO
  118.             CASE IS = CHR$(13) 'Enter
  119.                 'go up one dir
  120.                 IF RTRIM$(FileNames$(selection)) = ".." THEN
  121.                     cd$ = _CWD$
  122.                     cd$ = LEFT$(cd$, _INSTRREV(cd$, "\"))
  123.                     CHDIR cd$
  124.                     ERASE FileNames$
  125.                     GOTO loadagain
  126.                 END IF
  127.                 'see if directory
  128.                 test$ = RTRIM$(FileNames$(selection))
  129.                 IF LEFT$(test$, 1) = "[" THEN
  130.                     test$ = MID$(test$, 2, LEN(test$) - 2)
  131.                     CHDIR test$
  132.                     ERASE FileNames$
  133.                     GOTO loadagain
  134.                 ELSE
  135.                     IF RIGHT$(_CWD$, 1) = "\" THEN
  136.                         c$ = _CWD$
  137.                     ELSE
  138.                         c$ = _CWD$ + "\"
  139.                     END IF
  140.                     FileSelect$ = c$ + RTRIM$(FileNames$(selection))
  141.                     EXIT DO
  142.                 END IF
  143.         END SELECT
  144.     LOOP
  145.  
  146.     _KEYCLEAR
  147.  
  148.     '=== Restore the whole screen
  149.     _MEMCOPY scr2, scr2.OFFSET, scr2.SIZE TO scr1, scr1.OFFSET
  150.     _MEMFREE scr1: _MEMFREE scr2
  151.  
  152.     '=== restore original y,x
  153.     LOCATE origy, origx
  154.  
  155.     COLOR fg&, bg&
  156.  
  157.  
  158.  
« Last Edit: January 25, 2021, 09:58:25 pm by Dav »

FellippeHeitor

  • Guest
Re: Question about using SHELL "dir" on non windows OS.
« Reply #16 on: January 25, 2021, 09:43:21 pm »
There's _DEFAULTCOLOR for the foreground and _BACKGROUNDCOLOR for the bg. Links to wiki:

Code: QB64: [Select]

Save their values before you change COLOR, then restore when the procedure ends.
« Last Edit: January 25, 2021, 09:44:27 pm by FellippeHeitor »

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #17 on: January 25, 2021, 09:45:39 pm »
Ah... I missed that one.  Thanks, @FellippeHeitor.

EDIT: I fixed the code.  Restores color as should..

- Dav
« Last Edit: January 25, 2021, 09:50:57 pm by Dav »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #18 on: January 25, 2021, 09:56:48 pm »
Hold on Dav...

Code: QB64: [Select]
  1. COLOR 14, 4
  2. PRINT "SCREEN ZERO HERO!"
  3. ' Now lets save this original color...
  4. LOCATE 1, 1
  5. a = SCREEN(1, 1, 1)
  6. ' Now change color
  7. COLOR 7, 0
  8. LOCATE 3, 1
  9. PRINT "Back to white on black..."
  10. ' Now lets get back to our original color...
  11.  
  12. COLOR a MOD 16, a \ 16
  13. LOCATE 5, 1
  14. PRINT "That's how it's done, old school!"
  15.  

Hey, I just got my dir stuff completed over at QBF, too. I have to smooth a few things out, but it completes the directory searching just fine.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #19 on: January 25, 2021, 10:07:31 pm »
Hmm,well that seems to work, @Pete.  But I'm not sure how...I must have missed old school class that day!

- Dav

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #20 on: January 25, 2021, 10:21:19 pm »
SCREEN has a third parameter that reads the color attribute of the screen. The trick is knowing how to put that value back into the COLOR statement, which is foreground equals the number mod 16 and the background is the number integer division 16.

I'll have to give Steve's stuff a try out tomorrow, and have a peek at yours after you post it.

Pete

Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

FellippeHeitor

  • Guest
Re: Question about using SHELL "dir" on non windows OS.
« Reply #21 on: January 25, 2021, 10:22:02 pm »
Or just keep the _DEFAULTCOLOR and _BACKGROUNDCOLOR approach for all screen modes, 0 included. SCREEN won't work if nothing's been printed though, too.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #22 on: January 25, 2021, 10:54:13 pm »
Fell missed day 2 of Old School...

Code: QB64: [Select]
  1. SCREEN 0, 0, 0, 0
  2. ' PRINT "SCREEN ZERO HERO!"
  3. SCREEN 0, 0, 1, 0
  4. COLOR 14, 4
  5. PRINT " ";
  6. ' Now lets save this original color...
  7. LOCATE 1, 1
  8. a = SCREEN(1, 1, 1)
  9. SCREEN 0, 0, 0, 0
  10. ' Now change color
  11. COLOR 7, 0
  12. LOCATE 3, 1
  13. PRINT "Back to white on black..."
  14. ' Now lets get back to our original color...
  15.  
  16. COLOR a MOD 16, a \ 16
  17. LOCATE 5, 1
  18. PRINT "That's how it's done, old school!"
  19.  

Of course you can just print a blank space to a part of the screen not in use, and read it. Flipping to a separate hidden page is a bit overkill.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

FellippeHeitor

  • Guest
Re: Question about using SHELL "dir" on non windows OS.
« Reply #23 on: January 25, 2021, 11:34:26 pm »
@Dav Also, you're saving the last COLOR parameters the user of your library had set - in this case the last COLOR parameters you had set yourself before calling the sub. No way to do that with the SCREEN trick, as you have to pick a location to read the color from.

@Pete ❤️

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #24 on: January 26, 2021, 11:32:15 am »
@Dav Also, you're saving the last COLOR parameters the user of your library had set - in this case the last COLOR parameters you had set yourself before calling the sub. No way to do that with the SCREEN trick, as you have to pick a location to read the color from.

@Pete ❤️

There's always a way. If there wasn't, we woudn't have QB64 in the first place. It's just a question of the level of complexity needed in the chewing gum and bailing wire operations. I've gone as far as memory mapping, in a graphics gui thing I put together. This was before _MEMBLOCK came out and made my approach obsolete.

It's always a trade off. Better keywords create easier coding, but take away from solution based thinking on a lower level. One can only hope that coders will be freed up to use those solution skills for higher purposes.

Personally, I wanted this _DEFAULTCOLOR and _BACKGROUNDCOLOR stuff in QuickBASIC. I never could understand why the last color set couldn't be retrieved from memory. In Atari, that was accomplished with PEEK/POKE. Also, speaking of AtariBASIC, we could easily change the 8x8 pixels of any character, into a custom character. That feature made it super easy to underline words. I suppose if I want to do that with QB64, I'd have to go the way of unicode characters. That's probably something I'll be looking into in the near future. Fingers crossed it will include SCREEN 0, the only screen mode anyone should ever need.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #25 on: February 05, 2021, 05:38:33 pm »
Even though I'll be using direntry.h in the future, I went ahead and finished off this SHELL "dir" file box routine.  By doing so, I found out something worth noting about using KILL.   I was having a problem deleting the temp file using KILL in certain directories, such as "Documents and Settings".  The program would error report the file doesn't exist and halt, even though the file did exist.  Looks like KILL can't be used on files in restricted directories, it won't see them.  So I decided to use SHELL "del" to delete the temp file instead and it won't error out.  The file won't delete that way either under that directory, but the program will continue and not stop.

Here is what I ended up with.  Shows current directory at top now, and the ".." doesn't show when at the root.  Directories are different colors.  I hope I'm doing the right call under linux to delete the temp file.  For Mac, I have no idea...

Edit:  I guess the best thing to do is always use _FILEEXISTS before using KILL, all the time.

- Dav

Code: QB64: [Select]
  1. '==============
  2. 'FILESELECT.BAS
  3. '==============
  4. 'Simple file selector box. Coded by Dav, FEB/2021
  5. '(with the kind help of the QB64.org forum gurus)
  6.  
  7. 'Navigate through directories and select a file.
  8. 'Use arrows, page up/down, home, end to scroll list.
  9. 'Press enter to select highlighted file or enter the dir.
  10.  
  11. 'things to do: auto center box on screen, and ditch x/y input?
  12. '              ...will need to adjust box size based on file/dir chr length
  13. '              Add user defined colors instead...?
  14.  
  15.  
  16. SCREEN _NEWIMAGE(600, 600, 32)
  17.  
  18. CLS , _RGB(32, 32, 32)
  19.  
  20. '=== draw stuff
  21. FOR x = 1 TO 600 STEP 3
  22.     FOR y = 1 TO 600 STEP 3
  23.         PSET (x, y), _RGB(RND * 255, RND * 255, RND * 255)
  24.     NEXT
  25.  
  26. a$ = FileSelect$(5, 10, 15, 55, "*.*")
  27.  
  28. IF a$ <> "" THEN
  29.     PRINT "You selected: "; a$
  30.  
  31.  
  32.  
  33. FUNCTION FileSelect$ (y, x, y2, x2, Filespec$)
  34.  
  35.     '=== save original place of cursor
  36.     origy = CSRLIN: origx = POS(1)
  37.  
  38.     '=== save colors
  39.     fg& = _DEFAULTCOLOR
  40.     bg& = _BACKGROUNDCOLOR
  41.  
  42.     '=== Save whole screen
  43.     DIM scr1 AS _MEM, scr2 AS _MEM
  44.     scr1 = _MEMIMAGE(0): scr2 = _MEMNEW(scr1.SIZE)
  45.     _MEMCOPY scr1, scr1.OFFSET, scr1.SIZE TO scr2, scr2.OFFSET
  46.  
  47.     loadagain:
  48.  
  49.     top = 0
  50.     selection = 0
  51.  
  52.     IF INSTR(_OS$, "LINUX") THEN
  53.         SHELL _HIDE "find . -type d > $_TeMP_FILE_LIST"
  54.     ELSE
  55.         SHELL _HIDE "dir /b /A:D > $_TeMP_FILE_LIST"
  56.     END IF
  57.  
  58.     'get list...
  59.     REDIM FileNames$(5000) 'space for 5000 filenames
  60.  
  61.     'only show the ".." if not at root dir
  62.     IF LEN(_CWD$) <> 3 THEN
  63.         FileNames$(0) = ".."
  64.         LineCount = 1
  65.     ELSE
  66.         LineCount = 0
  67.     END IF
  68.  
  69.     FF = FREEFILE
  70.     OPEN "$_TeMP_FILE_LIST" FOR INPUT AS #FF
  71.  
  72.     WHILE ((LineCount < UBOUND(FileNames$)) AND (NOT EOF(FF)))
  73.         LINE INPUT #FF, rl$
  74.         FileNames$(LineCount) = "[" + rl$ + "]"
  75.         LineCount = LineCount + 1
  76.     WEND
  77.     CLOSE #FF
  78.  
  79.     'KILL "$_TeMP_FILE_LIST"
  80.     IF INSTR(_OS$, "LINUX") THEN
  81.         SHELL _HIDE "rm $_TeMP_FILE_LIST"
  82.         SHELL _HIDE "find . -type f " + CHR$(34) + Filespec$ + CHR$(34) + " > $_TeMP_FILE_LIST"
  83.     ELSE
  84.         SHELL _HIDE "del $_TeMP_FILE_LIST"
  85.         SHELL _HIDE "dir /b /A:-D " + Filespec$ + " > $_TeMP_FILE_LIST"
  86.     END IF
  87.  
  88.     FF = FREEFILE
  89.     OPEN "$_TeMP_FILE_LIST" FOR INPUT AS #FF
  90.     WHILE ((LineCount < UBOUND(FileNames$)) AND (NOT EOF(FF)))
  91.         LINE INPUT #FF, rl$
  92.         'skip the temp file...
  93.         IF rl$ <> "$_TeMP_FILE_LIST" THEN
  94.             FileNames$(LineCount) = rl$
  95.             LineCount = LineCount + 1
  96.         END IF
  97.     WEND
  98.     CLOSE #FF
  99.  
  100.     'KILL "$_TeMP_FILE_LIST"
  101.     IF INSTR(_OS$, "LINUX") THEN
  102.         SHELL _HIDE "rm $_TeMP_FILE_LIST"
  103.     ELSE
  104.         SHELL _HIDE "del $_TeMP_FILE_LIST"
  105.     END IF
  106.  
  107.  
  108.     'draw a box
  109.     COLOR _RGB(100, 100, 255)
  110.     FOR l = 0 TO y2 + 1
  111.         LOCATE y + l, x: PRINT STRING$(x2 + 4, CHR$(219));
  112.     NEXT
  113.  
  114.     'show current working dir
  115.     COLOR _RGB(255, 255, 255), _RGB(100, 100, 255)
  116.     CurDir$ = _CWD$
  117.     'Shorten it is too long, for display purposes
  118.     IF LEN(CurDir$) > x2 - x THEN
  119.         CurDir$ = MID$(CurDir$, 1, x2 - x - 3) + "..."
  120.     END IF
  121.     LOCATE y, x + 2: PRINT CurDir$;
  122.  
  123.     DO
  124.  
  125.         FOR l = 0 TO (y2 - 1)
  126.             LOCATE (y + 1) + l, (x + 2)
  127.             IF l + top = selection THEN
  128.                 COLOR _RGB(0, 0, 64), _RGB(255, 255, 255) 'selected line
  129.             ELSE
  130.  
  131.                 COLOR _RGB(255, 255, 255), _RGB(0, 0, 64) 'regular
  132.  
  133.                 'directories get a different color...
  134.                 IF MID$(FileNames$(top + l), 1, 1) = "[" THEN
  135.                     COLOR _RGB(255, 255, 0), _RGB(0, 0, 64)
  136.                 END IF
  137.             END IF
  138.             PRINT LEFT$(FileNames$(top + l) + STRING$(x2, " "), x2);
  139.         NEXT
  140.  
  141.         k$ = INKEY$
  142.         SELECT CASE k$
  143.             CASE IS = CHR$(0) + CHR$(72) 'Up arrow
  144.                 IF selection > 0 THEN selection = selection - 1
  145.                 IF selection < top THEN top = selection
  146.             CASE IS = CHR$(0) + CHR$(80) 'Down Arrow
  147.                 IF selection < (LineCount - 1) THEN selection = selection + 1
  148.                 IF selection > (top + (y2 - 2)) THEN top = selection - y2 + 1
  149.             CASE IS = CHR$(0) + CHR$(73) 'Page up
  150.                 top = top - y2
  151.                 selection = selection - y2
  152.                 IF top < 0 THEN top = 0
  153.                 IF selection < 0 THEN selection = 0
  154.             CASE IS = CHR$(0) + CHR$(81) 'Page Down
  155.                 top = top + y2
  156.                 selection = selection + y2
  157.                 IF top >= LineCount - y2 THEN top = LineCount - y2
  158.                 IF top < 0 THEN top = 0
  159.                 IF selection >= LineCount THEN selection = LineCount - 1
  160.             CASE IS = CHR$(0) + CHR$(71) 'Home
  161.                 top = 0: selection = 0
  162.             CASE IS = CHR$(0) + CHR$(79) 'End
  163.                 selection = LineCount - 1
  164.                 top = selection - y2 + 1
  165.                 IF top < 0 THEN top = 0
  166.             CASE IS = CHR$(27) ' ESC cancels
  167.                 FileSelect$ = ""
  168.                 EXIT DO
  169.             CASE IS = CHR$(13) 'Enter
  170.                 'go up one dir
  171.                 IF RTRIM$(FileNames$(selection)) = ".." THEN
  172.                     cd$ = _CWD$
  173.                     cd$ = LEFT$(cd$, _INSTRREV(cd$, "\"))
  174.                     CHDIR cd$
  175.                     ERASE FileNames$
  176.                     GOTO loadagain
  177.                 END IF
  178.                 'see if directory
  179.                 test$ = RTRIM$(FileNames$(selection))
  180.                 IF LEFT$(test$, 1) = "[" THEN
  181.                     test$ = MID$(test$, 2, LEN(test$) - 2)
  182.                     CHDIR test$
  183.                     ERASE FileNames$
  184.                     GOTO loadagain
  185.                 ELSE
  186.                     IF RIGHT$(_CWD$, 1) = "\" THEN
  187.                         C$ = _CWD$
  188.                     ELSE
  189.                         C$ = _CWD$ + "\"
  190.                     END IF
  191.                     FileSelect$ = C$ + RTRIM$(FileNames$(selection))
  192.                     EXIT DO
  193.                 END IF
  194.         END SELECT
  195.     LOOP
  196.  
  197.     _KEYCLEAR
  198.  
  199.     '=== Restore the whole screen
  200.     _MEMCOPY scr2, scr2.OFFSET, scr2.SIZE TO scr1, scr1.OFFSET
  201.     _MEMFREE scr1: _MEMFREE scr2
  202.  
  203.     '=== restore original y,x
  204.     LOCATE origy, origx
  205.  
  206.     COLOR fg&, bg&
  207.  
  208.  

« Last Edit: February 05, 2021, 05:44:35 pm by Dav »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #26 on: February 05, 2021, 10:07:30 pm »
Steve advised me one time to use one filename stored under Windows temp folder from environment variable.

Just write over that file, no need to kill, kill, kill unless you just like saying that to Windows.

I like your one box method everything in one window, Tiny Navigator is going to be rid of that pesky need to press f to select from files listing. Simple solutions often the best!
« Last Edit: February 05, 2021, 10:58:35 pm by bplus »

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #27 on: February 05, 2021, 10:51:04 pm »
That's a good thought, @bplus.  I'm not sure in Linux has a environment temp setting though, but perhaps I can do the one temp file in the programs _STARTDIR$ directory instead, that would bypass writing temp files in every directory browsed and writing any to restricted directories too.  Thanks for the idea. 

- Dav

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #28 on: February 05, 2021, 10:57:12 pm »
That's a good thought, @bplus.  I'm not sure in Linux has a environment temp setting though, but perhaps I can do the one temp file in the programs _STARTDIR$ directory instead, that would bypass writing temp files in every directory browsed and writing any to restricted directories too.  Thanks for the idea. 

- Dav

Well I thought when you were going to go for cross platform, you'd use the direntry.h method.

I know you wrote that somewhere, were you just teas'n me?  ;-))

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Question about using SHELL "dir" on non windows OS.
« Reply #29 on: February 05, 2021, 11:02:57 pm »
I'll be using direntry, but I wanted to get this method figured out.  One of my quirks I guess, can't let things go very easy while they're still gnawing on me.

- Dav