Skip to main content

Questions tagged [pset4recover]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
244 views

CS50/PSET4/RECOVER- Error- "Can't open card.raw: file format unsupported"

Keep getting "Can't open card.raw: file format unsupported" error when running the code. Not sure what I'm doing wrong. #include <stdio.h> #include <stdlib.h> int main(int argc, char *...
0 votes
1 answer
66 views

CS50 PSet 4 Recover, Segmentation Fault

My code compiles, but whenever I run Check50, I get a segmentation fault error for each category. Would definitely appreciate any help identifying where the problem can be fixed! #include <stdio.h&...
0 votes
2 answers
69 views

PSET4 Recover: Segmentation fault

I am receiving a segmentation fault stemming from line 95. This is where I am attempting to continue to write the remainder of a JPG file after finding it. [code hidden]
1 vote
1 answer
169 views

Can not find jpeg..recover problem from cs50 pset4

so I was trying to solve this recover problem from cs50.IT compiles well but it shows me this following problem :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :( ...
0 votes
1 answer
54 views

Pset4 Recover Segmentation Error. Valgrind unable to find anything

I'm sorry to bring about yet another segmentation fault but I cannot for the life in me find the error (Even valgrind is kinda malfunctioning). Here's my code- #include <stdio.h> #include <...
0 votes
1 answer
57 views

pset4 reError interpreting JPEG image file (Not a JPEG file: starts with 0x62 0x74)

below will be my code. on check50 I get: :( recovers 000.jpg correctly recovered image does not match :( recovers middle images correctly recovered image does not match :( recovers 049.jpg ...
0 votes
1 answer
74 views

PSET4 Recover - Code gets stuck at if statement

I'm working on the recover problem, but when my code gets to the if statement I made that checks for the header of a JPEG file, it gets stuck. I get no errors, it simply stops iterating through the ...
0 votes
1 answer
44 views

My latest two problems aren't being scored

I submitted one of my problem sets and I'm unable to get my problem scored. screenshots:
0 votes
1 answer
27 views

Pset4 recover code only shows parts of the picture

I've worked on the code and gotten it to the point where it recovers all 50 images. However, the images only display parts, usually starting in the top left corner. This is my current code. Can ...
0 votes
1 answer
70 views

pset4 - can't figure out what i'm doing wrong - recover

This is the code: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if (argc != 2) { return 1; } FILE *file = fopen(argv[1], "r&...
0 votes
1 answer
73 views

pset4 recover: too many JPEGs found

guys! I was solving recover, but my program finds way too many JPEGs. I believe that this is because of the following lines: // starting bytes of jpeg are in [lower, upper] uint8_t lower[4] = {0xff, ...
0 votes
1 answer
32 views

recover compiles but has segmentation fault when running it with ./recover card.raw, could anyone take a look

#include <stdio.h> #include <stdlib.h> #include <cs50.h> int main(int argc, char *argv[]) { //this counter to keep track of how many jpegs found so far int counter = 0; ...
0 votes
1 answer
45 views

pset4 Recover "grade"

I recently submitted my Pset4 Recover project to the new grading Bot....and received 0 of 100.....despite the fact that my program returns all 50 photos....reaches the EOF .....Valgrind shows 0 ...
0 votes
1 answer
548 views

Understanding Pset4 Recover Valgrind Errors

My code for Recover is passing all the tests in Check50 except for the final one on memory errors. When I run valgrind ./recover I get this: When I look into the details of why I'm not passing ...
0 votes
1 answer
99 views

Recover - error message when I test it : The file won t open to copy inside

I m struggling. Can't find why I have this error message :~/workspace/pset4/recover/ $ ./recover card.raw Could not open new file. Here is my code : //define data ...
0 votes
2 answers
18 views

Problem Set 4 Recover

I have written a solution to CS50's Problem Set 4 Recover, and my code produces all 50 images clearly (to me, at least). However, check50 says that the middle images and last images do not match what ...
0 votes
1 answer
151 views

pset4 recover only recovers 25 correct images

This is my code for recover. When I run the program, it gives me 25 successfully recovered photos. I don't know why it is only giving me half the required photos. I believe it might have something to ...
0 votes
1 answer
91 views

program is free of memory errors

Im about to finish pset4, currently on recover! Everything is ok at the first look, program compiles, however, there is a problem when I run check50. As you can see from the title, something is off ...
0 votes
1 answer
127 views

Pset4 Recover issues

I am having a number of problems with recover in pset4. First, my program is not finding a beginning of a jpeg. But, to test that, I have to first compile it, and I cannot because for some reason on ...
1 vote
1 answer
31 views

pset4 recover segmentation fault on code that compiles, I have looked many questions related to the problem but no luck so far

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <cs50.h> typedef uint8_t BYTE; const int BLOCK_SIZE = 512; int main(int argc, char *argv[]) { if (argc != 2)...
0 votes
1 answer
26 views

PSET4 Recover.c Want to understand If statement

My code only works if I separate the two if statements instead of nesting the highlighted if statement within the outer one though I don't understand why. The results are:
0 votes
1 answer
32 views

i am unable to open my cs50 card.raw file

#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { //open memory card FILE *memorycard = fopen("card.raw","r"); if (memorycard =...
0 votes
1 answer
1k views

CS50 Problem Set 4: Recover

I am getting a 'Segmentation fault (core dumped) error' I know that means I am accessing memory I shouldn't. I feel like it has something to do with my fread or fwrite functions. ''' #include <...
0 votes
1 answer
246 views

pset4 recover.c segmentation fault fread/fwrite

I am trying to complete recover.c for pset4, but I am having major trouble debugging. I get a segmentation fault after the first fwrite step has occured, and it creates the fault at the fread step at ...
0 votes
1 answer
28 views

Why is my recover code not giving any output?

I'm very confused why this code is not giving any output: Code: #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; long int findSize(char file_name[]) ...
1 vote
1 answer
52 views

CS50 recover (fclose giving segmentation fault)

found a few answers to the segmentation fault issue in CS50 recover while closing the file but I couldn't translate the answers to my issue: The last part: fclose(f); fclose(img); is resulting into ...
0 votes
1 answer
86 views

PSET4, RECOVER: Segmentation Fault

I have been trying to solve RECOVER from PSET4 and I keep getting a segmentation fault. Any ideas on why this happens? #include <stdio.h> #include <stdlib.h> #include <stdint.h> ...
0 votes
1 answer
173 views

Why can't I assign the return value of a fwrite() function to another variable? Infinite loop

In 'recover' I wanted to jump out of my while loop if the fwrite() function of the last photo (of the file) returns a value < 512 (indicating that the last photo or end of file is reached). I ...
0 votes
1 answer
40 views

Week 4 - Recover

All of the first 49 images get recovered fine except the last one. I have went through the code a lot, but still can't find the problem. #include <stdio.h> #include <stdlib.h> #include <...
1 vote
1 answer
51 views

Problem Set 4 - Recover (timed out while waiting for program to exit)

After spending almost a week working on the code for the Recover exercise, I have finally made it work. However, when I check with check50, I get the error: :( program is free of memory errors timed ...
0 votes
2 answers
65 views

CHECK50 Passes, but I Get 6/7 When Submitting

I've just completed pset4 - recover. I did quite a bit of debugging and was finally able to pass all checkmarks with check50, style50 and Valgrind. After submitting I checked my grade and I received 6/...
0 votes
1 answer
57 views

Pset4- recover: recovered jpgs appear to be empty

I tried to implement recover through the simplest and shortest way I could imagine. The code compiles and saves 50 JPGs with proper names, but when I open them, all of them are just empty and even ls -...
0 votes
0 answers
23 views

program in recover pset4, please help me find the errors and if you could add how to debug the code, its will be helpful

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("./usage: recover filename\n"); ...
0 votes
1 answer
58 views

in pset4, recover, why is the first jpg found treated differently from the other jpg files?

I'm starting to work on pset4, recover, and (as you can tell) things are not going well. I read posts from other students working on the same problem and realize some of them check for the jpg header ...
0 votes
1 answer
13 views

Pset 4 recover- sprintf format striing error

I have been on recover for a while now,and I am recieving an error when compiling the code: recover.c:31:42: error: data argument not used by format string [-Werror,-Wformat-extra-args] sprintf(...
1 vote
1 answer
49 views

Why does the 0.49 jpg file doesn't match correctly?

I'm doint the recover PSET04. I think, I've done everything correct expect of the 0.49 jpg file. It says that it doesn't match correctly. And the last error in Check50 is "can't check until a ...
0 votes
1 answer
30 views

P4 Recovers only first 512 bytes

im really struggling with this one and your help would be really appreciated My code is working quite good but theres a error with writing file wich i cannot fix // i will start with line where i ...
0 votes
1 answer
38 views

PS4 - Recover - expected exit code 0, not 139

my program works well, images are created correctly. But when I make check50 i get this strange error expected exit code 0, not 139 :) recover.c exists. :) recover.c compiles. :) handles lack of ...
0 votes
1 answer
48 views

pSet4: Recover Memory Leaking after opening a file

When I try to run my solution to recover in cs50 problem set 4, I get a segmentation fault. I tried to use check50, and I got a poor response for memory leaks. :( program is free of memory errors ...
0 votes
1 answer
57 views

Code for Good ol' Recover returns all fifty images (000-049), but doesn't pass Check50

I have gone through about 12 questions on the same issue - the code for recover works, but check50 isn't being kind: :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :) ...
0 votes
1 answer
20 views

pset4 recover- can't match

I'm having problem with my pset 4 recover assignment, my code can compile and produce 49 jpg documents with the right name, but check50 told me they don't match with the right jpgs. Is there anything ...
0 votes
1 answer
17 views

Weird question about PSET4 recover

I've encoutered a weird bug in recover.c the following is my code and an error occurs at the last part. recover.c:65:5: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] fclose(...
0 votes
1 answer
51 views

PSET4 Recover segmentation fault

Good afternoon/morning, I'm having problem with Problem set 4 Recover, My code can compile but Segmentation fault (core dumped) keeps going out, I checked on debug50 and it seems the segfault occurs ...
0 votes
1 answer
30 views

PS4: Recover - Code recovers all 50 images perfectly but fails check50. help pls :(

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <inttypes.h> int main(int argc, char *argv[]) { typedef uint8_t BYTE; FILE *outptr = NULL; //...
0 votes
1 answer
367 views

RECOVER, can't see images

I've been working on recover for days now. I've been able to solve the segmentation fault issues and the code compiles and creates all 50 jpg files, but doesn't write the files correctly. I played ...
0 votes
1 answer
49 views

Where am I mystaking ? pset4-RECOVER

I've been rewriting that code for about a week now and start beeing very confused about what I am doing wrong, I hope my logic isn't fully wrong but I have some doubts about my understanding of ...
0 votes
1 answer
104 views

pset4 recover error segmentation fault

Can i please get some help with my recover code? i have rewritten it so many times but i still get a segmentation fault i even unmalloc'd a few things but to no avail // recovers deleted images #...
0 votes
1 answer
32 views

Recover: Encountering many problems

My code compiles fine, but no jpg files are created. It seems like the condition that checks for the start of a jpg is never true, so the body of that if condition never executes. I'm also having ...
0 votes
1 answer
25 views

Recover code runs but doesn't generate any jpegs

at sure I didn't know how to even begin, but slowly started realizing how i can tackle this problem. after a bit i was stuck on how some stuff works so i looked up some recover tutorials that helped ...
0 votes
1 answer
67 views

Code compiles but files are not read. Recover pset4

Trying to find the problem i could track it to the else statement where ""printf("Could not open file because NULL.\n");"" is located. The files are not read at all or ...