summaryrefslogtreecommitdiff
path: root/filesw32.bas
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2025-06-20 06:32:41 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2025-06-20 06:32:41 -0400
commit79c227155bb8fda89c3cd8ff5367687b47a0f074 (patch)
treecb731df52c743c0129cec404cd358a71a63ca039 /filesw32.bas
parent2eef1bf3e30b7d1205afd83c31d103f900b35467 (diff)
downloadgwblog-79c227155bb8fda89c3cd8ff5367687b47a0f074.tar.gz
gwblog-79c227155bb8fda89c3cd8ff5367687b47a0f074.zip
Added batch file and files routines for running on modern Windows under PC-Basic. Added textile workaround for PC-Basic bug. Added ability to use long filenames, specifically using html as an extension, if LFN=1 is set, though PC-Basic doesn't allow it anyways.
Diffstat (limited to 'filesw32.bas')
-rw-r--r--filesw32.bas41
1 files changed, 41 insertions, 0 deletions
diff --git a/filesw32.bas b/filesw32.bas
new file mode 100644
index 0000000..b480fa6
--- /dev/null
+++ b/filesw32.bas
@@ -0,0 +1,41 @@
+15000 REM ==========================
+15001 REM Directory listing
+15002 REM
+15003 REM INPUT: DIREC$ - DIRECTORY
+15004 REM WITH MASK
+15004 REM OUTPUT: FL$ - FILE LIST
+15005 REM LC - FILE COUNT
+15006 REM Uses some more modern dir
+15007 REM flags to make it work
+15009 REM ==========================
+15010 SHELL "DIR /B "+DIREC$+" > DIR.LST"
+15020 OPEN "DIR.LST" FOR INPUT AS #10
+15030 REM COUNT THE FILES FIRST
+15040 LC = 0
+15050 WHILE(EOF(10) = 0)
+15060 LINE INPUT#10, L$
+15070 LC = LC + 1
+15080 WEND
+15090 CLOSE #10
+15093 IF C15000 = 1 THEN ERASE FL$
+15097 C15000 = 1
+15100 DIM FL$(LC)
+15110 OPEN "DIR.LST" FOR INPUT AS #10
+15120 IC = 1
+15130 WHILE(IC <= LC)
+15140 LINE INPUT#10, FL$(IC)
+15200 IC = IC + 1
+15210 WEND
+15220 CLOSE #10
+15230 SHELL "DEL DIR.LST"
+15240 RETURN
+15500 REM ==============================
+15501 REM Retrieve the current directory
+15502 REM OUTPUT - CURDIR$ Current dir
+15503 REM ==============================
+15510 SHELL "CD > DIR.LST"
+15520 OPEN "DIR.LST" FOR INPUT AS #10
+15530 LINE INPUT#10, CURDIR$
+15540 CLOSE #10
+15550 SHELL "DEL DIR.LST"
+15560 RETURN