lol...so I turned in this past assignment (program 4) just over 2 hours ago.
Unfortunately I had to turn it in a bit incomplete. My main issue was with the wildcard feature that we had to implement. So my goal this weekend is to rewrite a nice chunk of my code so it's back up to par before I start the next assignment (program 5) where we have to start implementing pipes.
Anyways, I haven't gone to bed yet, haha. So I was hoping you guys could help me come up with some new ideas on how to improve my wild card. For those of you that don't want to click on the link to see it, this is the wildcard:
Quote:
Add a limited wildcard expansion capability. The wildcard char-
acter for your shell is ’*’. In the simple version, the ’*’ appears
by itself. White space (or the beginning or end of the line) must
be on either side of the ’*’. In this case, replace the ’*’ by names
of all the files in the current working directory who’s name do
not start with a period. In the more complex version, if the ’*’
appears with a leading white space and trailing non-white space,
that is something like “ *xyz ”, replace the ’*’ and the following
characters with all file names in the current directory that end
with the context characters. Note: a double quote ends the con-
text characters. Finally, the sequence ’\*’ should put only the
’*’ in the expanded string. (Again, do not use file names that
start with a period.) The file names placed into the expanded
string must be separated by a single space character between file
names. You should not have leading or trailing spaces. Note:
If the trailing characters include a slash (/), generate an error
message and stop the processing of the current line. Also note:
If no file names are matched, the pattern must be put in the ex-
panded string. A final note: A double quote before a star should
be treated as having a leading space. Finally, don’t use a regu-
lar expression matching library to implement wildcard expansion.
You are to use opendir(3) and friends.
|
I'll try and post some of my code later on so you can kind of see what's going on. Essentially I have to implement my own fnmatch. I wish I could just use it, lol.
Anyways, any discussion/ideas/whatever is more than welcome and greatly appreciated. I am not expecting/wanting any code. Just discussion. Thanks a bunch
__________________
CPU Intel Core 2 Quad Q6600 Kentsfield (G0) @ 3.5 |
Motherboard GIGABYTE GA-965P-DS3 |
Memory 8GB CORSAIR DOMINATOR DDR2 1066 (PC2 8500 C5) |
Graphics Card EVGA 8800GTS 512MB G92 790/2000/1026 |
Hard Drive WD 640GB AALS Black | WD 1TB FALS Black x 2 |
Power Supply Thermaltake 750W ToughPower |
Case LIAN LI PC-V1100BPlus II Tweaked |
CPU cooling Xigmatek S1283 w/ S-Flex F and Backplate |
GPU cooling Accelero S1 w/ S-Flex F |
OS Windows 7 Pro RTM x64 | Ubuntu 9.04 x64 |
Monitor Samsung ToC T260 | HDHanns·G HG-216DPO |