Questions tagged [pset4recover]

The tag has no usage guidance.

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

Pset4 Recover Creating Segmentation Fault

Trying to work through Pset4 Recover. Currently getting a segmentation fault and not opening any new jpegs. My logic thinking here was to: Make sure user submits just 1 command line argument Open ...
0
votes
1answer
11 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
0answers
10 views

Recover, almost there… images doesn’t show correctly

I think I'm very close to getting this one right, but I've been trying different codes with the same results so I think my logic must be wrong. This code finds correctly the jpegs and creates the ...
0
votes
1answer
15 views

pset4 recover: Not getting as many files as the problem requires

After reading a few submissions for help here and in the subreddit, People have told me there should be 50 files in the memory card. I have made a loop that correctly reads the file, but as soon as I ...
0
votes
1answer
21 views

Pset4 Recovery Produces Corrupt Null Files & Skips An Image

I've been working at recovery for a while - I believe I'm nearly done with it - but right now my code is giving me serious problems. Currently, running ./recover card.raw produces 49 of the 50 images (...
0
votes
1answer
31 views

pset 4 - recover. Can't figure out what is going wrong!

Can't figure out what I'm doing wrong, I've spent like 2 days on it already, please help! #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if (argc != 2) {...
0
votes
1answer
29 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&...
1
vote
1answer
19 views

pset 4 - recover, can't figure out mistake

I can't figure out what I'm doing wrong, please help! #include <cs50.h> #include <stdio.h> #include <stdlib.h> #define BUFFER_SIZE 512 int main(void) { // open memory ...
0
votes
1answer
20 views

Pset4 Recover Segmentation Fault Issue

I'm having an issue with my code, and I was hoping you could help! I keep getting a segmentation fault error, and I'm not sure why. I've ran valgrind and according to its findings, the issue seems to ...
0
votes
1answer
18 views

Typedef uint8_t BYTE returns unknown type name

My recover.c programme returns unknown type on the cs50 ide, but on a different IDE, it compiles but stops short at the if statement that checks if it is a valid jpg file. Then returns segmentation ...
0
votes
0answers
30 views

Recover.c fprintf failing on the 35th file

So on the recover.c program, my program works to recover the first 34 images, but it segfaults on the 35th. I've determined that it has to do with the fprintf function, but it worked the first 34 ...
0
votes
1answer
15 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
1answer
21 views

Understanding the contents of the raw file

I'm playing around with file pointers in preparation for the Recover Problem. I'm trying to understand something here. I can't actually open up the raw file to read on my IDE. And neither can I read ...
0
votes
1answer
42 views

Stuck on recover

I am currently stuck on recover and cannot understand the fread function and how does it behave. I have watched all the shorts and explanations but i still don't get it. I also wasn't able to find any ...
0
votes
0answers
32 views

For pset4/recover i keep getting an error despite the pictures recovering when i run the program

could someone please identify whats wrong with my code. im a beginner and completely lost.
1
vote
2answers
40 views

Major Help Needed on CS50 - Recover

I would love any possible help with this code. I think I've got the general idea, but I keep running into segmentation faults. Thank you to anyone who gets a chance to look this over! I've been very ...
0
votes
1answer
46 views

Pset4 Recover - Unexpected Output

My program outputs JPEG files, but not enough and they are corrupted. It has been a long day and it is Friday. Any kind of push in the right direction would be fantastic thank you. #include <stdio....
0
votes
1answer
46 views

PSET4 Recover: Where do my ###.jpg files end up?

My code looks right, and after some segmentation errors, I finally fixed that, but I've run into a problem: My created ###.jpg files don't actually seem to be written to anywhere, as in I can't find ...
0
votes
1answer
34 views

pset4 - My recover programme compiles but doesn't generate JPEGs as expected

After 12hrs of banging my head against this, and having trawled Stack Exchange, I've decided that it's time to ask for help! Really not sure where I'm going wrong, but suspect it's related to the ...
0
votes
1answer
22 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 ...
1
vote
1answer
17 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
1answer
57 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
1answer
23 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; //allocate a ...
0
votes
0answers
26 views

Segfault error, please help

I really need help, I'm getting a segfault error. Please look through my code and help me, please. #include <stdio.h> #include <stdlib.h> #include <stdint.h> int main(int argc, char ...
0
votes
2answers
43 views

Incompatible pointer types passing BYTE to FILE

#include <stdio.h> #include <stdlib.h> #include <stdint.h> //Define BYTE typedef uint8_t BYTE; int main(int argc, char *argv[]) {//Check if command line is correct// if (argc != ...
0
votes
1answer
36 views

Code only detects one jpeg in pset4 recover problem

my code for pset4 recovery only detects one jpeg signature. Here's my code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <...
-2
votes
1answer
49 views

While loop for recover pset4

I need a plain English explanation of how the while loop operates for the fread statement. After reading in the first 512 bytes, how does it loop to the next 512 bytes till it gets to the last block?
0
votes
1answer
69 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
1answer
94 views

PSet4 Recover, only finds 22 corrupted photos, doesn't pass Check50

Originally, my code always returned Segmentation Faults whenever running it. I used printf statements to find and fix the segmentation faults, but now it is only finding 22 out of the 50 photos and ...
0
votes
1answer
346 views

Help with “RECOVER” Pset4

My program keeps failing the last 3 on check50 '.jpg not found'... I dont see what the problem is, can someone help? #include <stdio.h> #include <stdlib.h> #include <stdint.h> ...
0
votes
1answer
33 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
1answer
35 views

Pset 4 Recover - Middle Images Don't Recover Correctly

When I run recover, most of the pictures get recovered correctly (first and last are correct), but some in the middle don't for some reason. Any ideas why? Any help would be appreciated. #include <...
0
votes
1answer
45 views

CS50 pset4 recover.c produces unsupported jpg images

Here is my code. Please help. #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <stdbool.h> #define BLOCK_SIZE 512 #define FILE_NAME_SIZE 8 typedef uint8_t ...
0
votes
1answer
165 views

(pset4) Fatal error: glibc detected an invalid stdio handle

everyone! I've been stuck with this one for a little while. Through debugging I found out that my problem is probably in the size parameter I'm trying to pass to fread() in line 33 (start of the while ...
0
votes
2answers
86 views

Why does my Cs50 recover programme correctly recover all images except the first one?

I wrote the below code and it recovers 51 images: 000.jpg to 050.jpg- all images except img 000 seem to have been found correctly. I'm not sure why the code isn't working? include include include ...
0
votes
0answers
23 views

Recover: when using fread it is storing \000 instead of 512 different bytes?

I am new to coding and struggling with the recover task. I am wanting to read the first 512 bytes from the file "card" and place them into a buffer. I've tried this: unsigned char buffer[512]; ...
0
votes
1answer
63 views

Recovers images, but Check50 is not happy!

I have successfully (or I guess not super successfully) recovers all 50 images, but where am I going wrong? Thanks! #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[])...
0
votes
1answer
17 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
1answer
36 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
2answers
48 views

CS50 pset 4 recover, only two images recovered

I am currently working on pset4 recover.c. My code complies correctly, but when I run it, only two files are outputted (000.jpg & 001.jpg), which I believe there should be 50 files. I'm not sure ...
0
votes
0answers
25 views

CS 50 Recover, Genrating blurred or pixalated images!

I have been stuck at this code for quiet a while now and i am finally able to generate all the images but the images are pixalated and not correct . I have seen online as why this might happen and ...
0
votes
2answers
56 views

Can't write jpegs in recover, segmentation fault

here's the code i wrote: #include <stdio.h> #include <stdint.h> #include <stdlib.h> typedef uint8_t BYTE; //take command line argument from the user for the file name int main(int ...
0
votes
1answer
57 views

Recover doesn't provide any images

Not sure why there are not results from this program, recover literally does nothing. Better than my old program that created over 500 images I guess. #include <stdio.h> #include <stdlib.h&...
0
votes
1answer
54 views

Pset 4 - Fopen returns NULL

Currently working on the Pset4 recover.c assignment. My code compiles correctly, however, when I execute, fopen return NULL. Based on my understanding from the shorts on file pointer and the lecture, ...
0
votes
1answer
40 views

Problem with fread() in Pset4 Recover

Please could I get some help with Pset 4's Recover? Each time I run the programme, it reach a segmentation fault I have worked my way through debug50 and identified that there is an issue at the ...
0
votes
1answer
31 views

pset 4 - recover, almost done! images opens correctly but check 50 doesn´t recognize it

My programs seems to work nicely,i can even see the images, i just don´t get what´s going on with Check50, must be a tiny detail. Thank you. Here is check50 : https://submit.cs50.io/check50/...
0
votes
1answer
58 views

PSET 4- RECOVER getting 22 pictures and none good

I keep looking my code and connot identify what is going on. I open 22 pictures, but none of them are good. It doesn't even write in the entire picture, some of them just a part of the picture is ...
0
votes
1answer
86 views

Pset4/recover: code is working fine but the recoverd images are not correct

I have written this code. The code seems to work fine but the images are not correct they are distorted. I have attached those photos below. Can you please help me and tell me where I went wrong in ...
0
votes
1answer
59 views

pset4 recover: 'recovered image does not match'

My program recovers the images but the recovered images are all blank and check50 says that they "don't match". All the images are 512 bytes in size. Please help me find out why this is happening. My ...
0
votes
1answer
52 views

pset4 recover 049.jpg recovered image does not match

I cant understand why 049.jpg is not working #include <stdio.h> #include <stdlib.h> #include <stdint.h> unsigned char bytes[512]; //counter for the jpg files int jpgCount = 0; ...