CompuServe Messages

LS Function

#: 5047 S9/SoftwareDevelopmentForum unknown
    13-Jan-86 00:07:03
Sb: #5039-LS Function
Fm: Rick Schaeffer 70120,174
To: Joe Kaisler 72606,1404

This message turned up in search, but its forum couldn’t be identified from the original transcript, so it may not be linked into its thread.

No problem, Joe. I plan to upload it…along with the other source as soon as I get word on how to proceed. It uses the wildexp function that I wrote (and plan to also upload). The current dir was handled by obtaining the current task pointer by calling "FindTask" with a NULL pointer. The current task pointer points at a process structure which contains a variable called "CurrentDir". This is a lock for the current directory and can be used in an "Examine" call. However, to simplify things, I do a "DupLock" on it. In one program I have also called "ParentDir" with it until I get a NULL return…and that gives me the complete path to the current directory. LS isn't quite the same as Unix LS. For one thing it doesn't yet support all of the options, and for another it doesn't sort the directory. It was very much a quick&dirty hack because I dislike the AmigaDos wildcard setup. I plan to do the rest of the options later…and perhaps make it sort although thats kind of a gimme. Rick Schaeffer