User Tools

Site Tools


haas:spring2021:cprog:projects:cbf0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:spring2021:cprog:projects:cbf0 [2021/03/22 14:47] – [Opening a file with fopen()] wedgehaas:spring2021:cprog:projects:cbf0 [2021/03/22 14:53] (current) – [Submission] wedge
Line 63: Line 63:
   * a - open file for appending (add to end)   * a - open file for appending (add to end)
  
-If we wanted to open the hypothetical file "**sample0.txt**" in the current directory for **reading**, using the file pointer **input**, we would do the following:+If we wanted to open the file "**sample0.txt**" in the **in/** sub-directory off our current working directory for **reading**, using the file pointer **input**, we would do the following:
  
 <code c> <code c>
-    input  = fopen ("sample0.txt", "r");+    input  = fopen ("in/sample0.txt", "r");
 </code> </code>
  
Line 108: Line 108:
  
 <cli> <cli>
-lab46:~/src/cprog/cbf0$ cat sample0.txt+lab46:~/src/SEMESTER/DESIG/cbf0$ cat in/sample0.txt
 >ABCDEFGHIJKLMNOPQRSTUVWXYZ< >ABCDEFGHIJKLMNOPQRSTUVWXYZ<
 [abcdefghijklmnopqrstuvwxyz] [abcdefghijklmnopqrstuvwxyz]
Line 117: Line 117:
 )!@#$%^&*( )!@#$%^&*(
 . .
-lab46:~/src/cprog/cbf0$ +lab46:~/src/SEMESTER/DESIG/cbf0$ 
 </cli> </cli>
  
Line 125: Line 125:
  
 <cli> <cli>
-lab46:~/src/cprog/cbf0$ xxd sample0.txt+lab46:~/src/SEMESTER/DESIG/cbf0$ xxd in/sample0.txt
 00000000: 3e41 4243 4445 4647 4849 4a4b 4c4d 4e4f  >ABCDEFGHIJKLMNO 00000000: 3e41 4243 4445 4647 4849 4a4b 4c4d 4e4f  >ABCDEFGHIJKLMNO
 00000010: 5051 5253 5455 5657 5859 5a3c 0a5b 6162  PQRSTUVWXYZ<.[ab 00000010: 5051 5253 5455 5657 5859 5a3c 0a5b 6162  PQRSTUVWXYZ<.[ab
Line 137: Line 137:
 00000090: 4546 3a48 4558 4144 4543 494d 414c 0a29  EF:HEXADECIMAL.) 00000090: 4546 3a48 4558 4144 4543 494d 414c 0a29  EF:HEXADECIMAL.)
 000000a0: 2140 2324 255e 262a 280a 2e0a            !@#$%^&*(... 000000a0: 2140 2324 255e 262a 280a 2e0a            !@#$%^&*(...
-lab46:~/src/cprog/cbf0$ +lab46:~/src/SEMESTER/DESIG/cbf0$ 
 </cli> </cli>
  
Line 183: Line 183:
  
 <cli> <cli>
-system:~/src/desig/cbf0$ ./cbf0 in/sample0.txt+system:~/src/SEMESTER/DESIG/cbf0$ ./cbf0.$(uname -m) in/sample0.txt
 00000000: 3e 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f  >ABCDEFGHIJKLMNO 00000000: 3e 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f  >ABCDEFGHIJKLMNO
 00000010: 50 51 52 53 54 55 56 57 58 59 5a 3c 0a 5b 61 62  PQRSTUVWXYZ<.[ab 00000010: 50 51 52 53 54 55 56 57 58 59 5a 3c 0a 5b 61 62  PQRSTUVWXYZ<.[ab
Line 200: Line 200:
  
 <cli> <cli>
-system:~/src/desig/cbf0$ ./cbf0 in/sample0.txt 4+system:~/src/SEMESTER/DESIG/cbf0$ ./cbf0.$(uname -m) in/sample0.txt 4
 00000000: 3e 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f  >ABCDEFGHIJKLMNO 00000000: 3e 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f  >ABCDEFGHIJKLMNO
 00000010: 50 51 52 53 54 55 56 57 58 59 5a 3c 0a 5b 61 62  PQRSTUVWXYZ<.[ab 00000010: 50 51 52 53 54 55 56 57 58 59 5a 3c 0a 5b 61 62  PQRSTUVWXYZ<.[ab
Line 216: Line 216:
 #include <sys/ioctl.h> #include <sys/ioctl.h>
  
-int main (void)+int main ()
 { {
     struct winsize terminal;     struct winsize terminal;
Line 404: Line 404:
   * Submit a copy of your source code to me using the **submit** tool.   * Submit a copy of your source code to me using the **submit** tool.
  
-To submit this program to me using the **submit** tool, run the following command at your lab46 prompt:+To submit this program to me using the **submit** target in the Makefile, run the following command at your lab46 prompt:
  
 <cli> <cli>
-$ submit cprog cbf0 cbf0.c +lab46:~/src/SEMESTER/DESIG/cbf0make submit 
-Submitting cprog project "cbf0": +...
-    -> cbf0.c(OK) +
- +
-SUCCESSFULLY SUBMITTED+
 </cli> </cli>
  
haas/spring2021/cprog/projects/cbf0.1616424465.txt.gz · Last modified: 2021/03/22 14:47 by wedge