CompuServe Thread

Forum unknown · SoftwareDevelopment

#LS Function

3 messages in this thread
#5039From: Joe KaislerJan 12, 1986 10:58 PM
Rick, I would definitely like the source you have for LS, I have some ideas about what the function should do and some other things too. Mainly, I am interested in how you attack the current dir problem. If you don't want to upload it here, call my bbs at 301-254-8078 24hrs (1200 baud only for now). Joe
#5047From: Rick SchaefferJan 13, 1986 12:07 AM
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
#5047From: Rick SchaefferJan 13, 1986 12:07 AM
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