You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function `xps_get_mime()` returns the MIME type of a file based on its extension. A MIME type lookup table (`mime_types`) maps file extensions (e.g., ".html", ".jpg") to their corresponding MIME types (e.g., "text/html", "image/jpeg"). This tells the browser how to display or interact with the file. For example, an HTML file is rendered as a web page, while an image is displayed as a picture. We won’t be using this functionality in the present stage but would be looking into in later stages.
As we are mapping the MIME type based on the file extension, a function for finding the file extension is added in `xps_utility`. Add the below given function in utility.c
91
+
As we are mapping the MIME type based on the file extension, a function for finding the file extension is added in `xps_utils.h`. Add the below given function in `xps_utils.c`
92
92
93
93
```c
94
94
constchar *get_file_ext(const char *file_path) {
@@ -108,7 +108,7 @@ Also declare the newly created function in utility.h
108
108
109
109
The code below has the contents of the header file for `xps_file`. Have a look at it and make a copy of it in your codebase.
110
110
111
-
:::details **expserver/src/disc/xps_file.h**
111
+
:::details **expserver/src/disk/xps_file.h**
112
112
113
113
```c
114
114
#ifndef XPS_FILE_H
@@ -157,7 +157,7 @@ Several file system-related C standard library functions are used to handle file
Opens a file specified by filename and returns a pointer to a FILE structure that represents the file stream. If mode given as “rb”, it opens the file in binary read mode. **Returns**: A pointer to a FILE structure if successful, or NULL if the file cannot be opened .
160
+
Opens a file specified by filename and returns a pointer to a FILE structure that represents the file stream. If mode given as “rb”, it opens the file in binary read mode. **Returns**: A pointer to a FILE structure if successful, or NULL if the file cannot be opened.
161
161
162
162
-`fclose()`
163
163
@@ -241,7 +241,7 @@ The functions in xps_file.c are given below:
Copy file name to clipboardExpand all lines: docs/roadmap/phase-1/stage-6.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -638,7 +638,7 @@ In Stage 5, we had three types of events that could occur in epoll:
638
638
Since this stage involves receiving a message from the client, reversing it and sending it back, we won’t not be needing upstream. We will work on the first two types of events:
639
639
640
640
::: tip NOTE
641
-
Upstream will have its own module (`xps_upstream`) and will be implemented in Stage 9.
641
+
Upstream will have its own module (`xps_upstream`) and will be implemented in Stage 11.
0 commit comments