code was posted under another forum subject just decided to put it here.
the code for both programs was modified a little to make the outcome easier to sort, if the output is redirected to a file.
credit goes to Pierre Bellisle and Michael Mattias for helping me.
these programs will find a hidden subdirectory then display its contents, you must specify the hidden directory specifically to get a listing.
working on that hidden directory listing stuff.
program 1
the code for both programs was modified a little to make the outcome easier to sort, if the output is redirected to a file.
credit goes to Pierre Bellisle and Michael Mattias for helping me.
these programs will find a hidden subdirectory then display its contents, you must specify the hidden directory specifically to get a listing.
working on that hidden directory listing stuff.
program 1
Code:
'compiled with pbcc 4.03 #COMPILE EXE '#DIM ALL #INCLUDE "WIN32API.INC" FUNCTION PBMAIN () AS LONG MAINDIR$=CURDIR$ DIRLIST$=TRIM$(COMMAND$) IF LEN(DIRLIST$)=0 THEN DIRLIST$=MAINDIR$ TRY CHDIR DIRLIST$ CATCH junk$=CURDIR$(MAINDIR$) STDOUT " directory = "+DIRLIST$ STDOUT " timestamp = "+DATE$+" "+TIME$ STDOUT " ------no directory was found---------------" STDOUT " ------end of directory listing-------------" EXIT TRY FINALLY STDOUT " directory = "+CURDIR$ STDOUT " timestamp = "+DATE$+" "+TIME$ STDOUT " ------files inside directory---------------" FILES&=0 SUBDIRECTORIES&=1 A$ = DIR$("*.*", (0 OR 1 OR 2 OR 3 OR 4 OR 32)) WHILE LEN(A$) FILES&=1 STDOUT A$ A$ = DIR$ WEND IF FILES&=0 THEN STDOUT " ------no files found-----------------------" STDOUT " ------subdirectories inside directory------" A$ = DIR$("*.*",16) WHILE LEN(A$) IF (GETATTR(A$) AND 16) THEN SUBDIRECTORIES&=1:STDOUT "<DIR> "+A$ A$ = DIR$ WEND IF SUBDIRECTORIES&=0 THEN STDOUT " ------no subdirectories found--------------" STDOUT " ------end of directory listing-------------" EXIT TRY END TRY END FUNCTION
Comment