Anyone have a routine which will sort & print a directories long file names to a text file?
------------------
------------------
dim r$(3000) path$ = "c:\windows\" 'or whatever mask$ = "*.*" sfn$ = dir$(path$ + mask$) do until sfn$ = "" lfn$ = longfilename$(sfn$) 'You may need to add the path incr i 'don't know. r$(i) = lfn$ 'add the path if needed sfn$ = dir$ loop array sort r$(1) for i open "somefile.txt" for binary as #1 for x = 1 to i put$ #1,f$(x) + crlf$ next x close #1 end function longfilename$(sfn$) sfn$ = remove$(sfn$,chr$(0)) sfn$ = sfn$ + chr$(0) lfn$ = string$(260,chr$(255)) reg 1, &h7160 reg 3, 2 reg 5, strptr(sfn$) reg 8, strseg(sfn$) reg 6, strptr(lfn$) reg 9, strseg(lfn$) call interrupt &h21 lfn$ = remove$(lfn$,chr$(255)) function = lfn$ end function
C:\ dir /?
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment