cs531-f19 / discussions

Discussions board for CS 431/531 Web Server Design course
2 stars 12 forks source link

Issue with Assignment 1 files #36

Open ghost opened 4 years ago

ghost commented 4 years ago

Hello,

In testing my webserver I have discovered that the tarball containing the sample files for this course contains an error. Specifically a1-test/4/directory3isempty, a file intended to be an empty directory is in fact a 0 byte file

stat directory3isempty                                                                   
  File: directory3isempty
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 811h/2065d  Inode: 20581321    Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   tyler)   Gid: ( 1000/   tyler)
Access: 2019-09-23 21:30:51.203276000 -0400
Modify: 2018-10-19 22:33:21.000000000 -0400
Change: 2019-09-23 21:30:51.203276391 -0400
 Birth: -

I have downloaded another copy to ensure this was not a mistake on my end.

bwmabe commented 4 years ago

It shows up as a 0-byte file with the permissions -rw-r--r-- both for me and in the tree shown here too. https://github.com/ibnesayeed/webserver-tester/tree/master/sample

However, judging by the filename, it might be intended? Assuming that it refers to a1-test/3/, which is an empty directory.

ghost commented 4 years ago

If you check the test case for test_get_empty_directory in the source of the webserver-tester, it seems to be intended for our webservers to handle it being a directory

ibnesayeed commented 4 years ago

This is intentional and a clever wordplay. Perhaps the description of the test case can be improved. In Unix even the empty directories have some non-zero size (default value corresponding to the minimum number of inode records). directory3isempty is indeed a file that tells that the other directory is empty, but it has nothing to do with that empty directory. we would be testing if the server returns the default application/octet-stream content-type for an unknown file type (as there is no file extension here). This would have been the case if the server had to return a directory (which obviously has no defined content-type). In this assignment, we don't know what requesting a directory even mean. In the next assignment however, we will implement directory listing or returning a default index file if present.

ibnesayeed commented 4 years ago

I have updated the test case description to better reflect the intent.