Expanded description including how much time was spent on task.
Wrote PROPOSAL.md
. Spent about 40 minutes.
Wrote get_file_listing()
. Spent about 30 minutes including debugging.
Fixed the display_dir()
function and optimized to make the code shorter. The function was also skipping directories within the given directory, so I fixed that as well. This took around 15 minutes.
Created process.h
file with functions necessary to open child processes and decide which program to run for some selected file in the file manager. Fixed an include guard inconsistency.
Code open_file_program()
function under process.c
, using execlp()
and xdg-open
to open some given file dynamically. Tested all the data functions. Fixed get_file_listing()
function, which in particular was causing many segmentation faults. I also made the function use a custom struct finfo
which combines data from a struct dirent
and a struct stat
to give all the possibly necessary information of the file in one data structure. Finally, I setup ncurses
(edited the makefile accordingly with -lncurses
flag) and tested moving the cursor around with the wmove()
function.
Advanced development of the terminal UI with ncurses
significantly. Two windows are drawn side-by-side, one with directory listing and the other with metadata of the current file. Implemented directory browsing by accepting arrow-key input and adjusting index of current file in struct finfo
list accordingly. The metadata is also updated accordingly whenever the user moves to a different file in the directory. Tested preliminary borders; found issue that drawing borders overwrites printed text. This will most likely be fixed by using mvwprintw()
. Also created helper functions display_dir()
and display_metadata
in display.c
. Took about 1.5 hours of time total.
Used getch()
to detect if enter key was pressed and then open the hovered on directory/file accordingly. If it was a file, it is opened with xdg-open (through execlp()
), and if it is a directory, the working directory of the program is changed and the file list is re-rendered. I also fixed Rahel's use of sorting the list with a custom comparator, making the parameters const void *
. Also, the borders were being overwritten by the rendered text, so I used mvwprintw()
instead to print the lines one extra character to the right so the border characters weren't touched. Finally, I increased include.h
to include all of the imports for every file in the project. Took about 2 hours in total.
Fixed directory switching and added for keybindings. Vim keys can now be used to move around the file managaer - j/k to go up and down the directory listing, and h/l to go back and forth between directories. I also fixed directory opening to remove segmentation faults. Tried to implement preview of a directory when hovered on on the right window (since there isn't much metadata to show about a directory), but there is a segmentation fault that needs to be addressed. I also optimized our directory listing sorting by only sorting when the working directory changes (i.e. when get_file_listing()
) is called instead of every time the directory is displayed. Took about 1.5 hours in total.
Fixed segmentation faults ocurring due to dependence on the size of d_name
in struct dirent
. Changed struct finfo
to accomodate file name and type without needing the store a dirent. Added a taskbar that displays current time and directory size. Colored directories and used signal handling to handle SIGINT and automatically redraw the screen when the terminal is resized. Took about 3 hours in total including debugging.
Expanded description including how much time was spent on task.
Worked on PROPOSAL.md
for 20 minutes
Worked on data functions (create and display file) for 35 minutes including debugging
Created file manipulation functions (rename, delete, move) using stdio builtin functions
Modified data.h with functions required for file manipulation.
Implemented color customization for window division in UI. Redefined magenta and initialized in pair 1. Issues with borders and custom attributes on text. Created a sort function to sort the files displayed by display_dir. Looks very nice. Took about 50 minutes.
Resize contents if an xterm is resized. All windows are redrawn based on new height and width. Used sigwinch signal for sighandler. 1.2 hours.
Created file/dir functions that delete them. Incorporated recursive deletion into delete_dir. Also created file/dir functions that create them. Took about 4 hours including debugging.