aboutsummaryrefslogtreecommitdiffstats
path: root/P2
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-11-03 09:12:27 -0600
committerMatt Strapp <strap012@umn.edu>2020-11-03 09:12:27 -0600
commit61b6b76c349f20bb3d5cf806b14860715dfe121e (patch)
treeb3ed4d7455c34434607dbf6d9393c7f1a9b14b16 /P2
parentStart on dir traversal (diff)
downloadcsci4061-61b6b76c349f20bb3d5cf806b14860715dfe121e.tar
csci4061-61b6b76c349f20bb3d5cf806b14860715dfe121e.tar.gz
csci4061-61b6b76c349f20bb3d5cf806b14860715dfe121e.tar.bz2
csci4061-61b6b76c349f20bb3d5cf806b14860715dfe121e.tar.lz
csci4061-61b6b76c349f20bb3d5cf806b14860715dfe121e.tar.xz
csci4061-61b6b76c349f20bb3d5cf806b14860715dfe121e.tar.zst
csci4061-61b6b76c349f20bb3d5cf806b14860715dfe121e.zip
work on it more
Diffstat (limited to '')
-rw-r--r--P2/lib/utils.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/P2/lib/utils.c b/P2/lib/utils.c
index 22ebfae..39e058f 100644
--- a/P2/lib/utils.c
+++ b/P2/lib/utils.c
@@ -101,11 +101,15 @@ void shuffle(int nMappers, int nReducers) {
DIR *dir = opendir(newpath);
struct dirent* entry;
while ((entry = readdir(dir)) != NULL) {
- //message.msgType = hashFunction(/* SOMETHING ,*/ nReducers);
- msgsnd(id, &message, chunkSize, 0);
- }
- }
+ if (!strcmp(".", entry->d_name) || !strcmp("..", entry->d_name))
+ continue;
+
+ //message.msgType = hashFunction(/* SOMETHING ,*/ nReducers);
+ msgsnd(id, &message, chunkSize, 0);
+ }
+ closedir(dir);
+ }
}
// check if the character is valid for a word