How to proceed with files that are sockets, pipes/FIFOs, block devices, char devices? Must hash them as well?.Handle very deep directory trees (mind the open file descriptors).Handle large files well(again, mind the RAM).An example would be a file's name changes but the rest of the contents remain the same and they are all fairly large files While traversing recursively they will be hashed eventually but should the directory entry names of that level be hashed to tag this directory? Helpful in use cases where the hash is required to identify a change quickly without having to traverse deeply to hash the contents. If it's a directory, its contents are just directory entries.Follow or not to follow(resolved name) the symlink while hashing the contents of the entry.For a symbolic link, its content is the referent name.Hash the file contents of all entries (leaving the meta like, inode number, ctime, atime, mtime, size, etc., you get the idea).Hash only the entry name of all entries in the directory tree.Different approaches for different needs/purpose (all of the below or pick what ever applies):.First things first, don't hog the available memory! Hash a file in chunks rather than feeding the entire file.These files were created by setting INITIALBUCKETS value in global_defs.h to 2 and 100, respectively, compiling, and then renaming the hashTab executable appropriately. You can copy the ~merle/109/prog2/hashTab_init2buckets and ~merle/109/prog2/hashTab_init100buckets executables to your prog2 directory to compare their output and return code against your program’s output and return code. Use the hashTab.c and hashTab_funcs.h files, without modification, as your top-level/main file and program-specific-function header file, respectively. Same goes for CHAININGTHRESHOLD, PERCENTAGETHRESHOLD, and RESIZEPERCENTAGE. To do so, simply change the “#define INITIALBUCKETS 100” to a smaller value and recompile. Make sure you change the access privileges so no one else can see the directory’s contents.ĭuring development, you may find it beneficial to work with a smaller INITIALBUCKETS value. It is recommended you create a directory structure of cse109.fall2021/prog2 under your home directory, and do your development work for this assignment in the prog2 directory. Except for syscall errors and the conditions specified below, the return code is 0.Ģ01 - Incorrect/unexpected argument enteredkj Your Stevens-style wrapped system calls should exit with the errno value and the strerror(errno) message (still to stderr). ![]() When we compile for grading, we will not compile with -DDEBUG, and it is fine if your submitted code has statements like “#ifdef DEBUG …” or “if (DEBUG) ”.Įxit with the following return code and an appropriate message to stderr under the following conditions. This is fine, so long as it is obvious this is NOT your primary method for debug… which should be gdb. You may choose to pass -DDEBUG as a parameter to gcc to print additional information during debug. You need to create a makefile to manage the selective compilation of your relocatable and executable objects files. Your Stevens-style wrapped functions are to be placed in syscalls. You will need to create and manage the following files: hashTab_funcs.c, syscalls.h, and syscalls.c. You are given hashTab.c, global_defs.h, and hashTab_funcs.h. The table auto-resizes to maintain "optimum" performance. U key value # if key not in the table, value will be stored and a warning printedĭ key # if key not in the table, a warning will be printed R key # if key not in the table, a warning will be printed, otherwise value format is: action key action is one of the following characters: c r u dĬ key value # if key already in table, value will be updated and a warning printed Commands to perform the aboveĪctions may be specified in the input text file as follows. Keys can be any integer in the range and values can beĪny integer in the range. HashTab creates, retrieves, updates, and deletes key-value pairs in a hash table. ![]() ![]() Write a program whose executable name will be hashTab and which conforms to the following “specification” (which is actually the help message). Structures and accessing structure membersĭescription of Program and Program Requirements Prog2 - hashTab - Description CSE109 Fall 2021 Hashtab-jackwkeane created by GitHub Classroom ![]() Note:Īll programs were written and optimized for X86-64 machines with gcc module 7.10. Completed fall of 2021 as a part of Lehigh University's CSE 109: System Software.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |