Best solution I can come up with is too strrchr then copy the what remains of the text file. If only the strch charecter is left then it is just before the EOF. Anyone have a better method?
Type: Posts; User: Rhidian
Best solution I can come up with is too strrchr then copy the what remains of the text file. If only the strch charecter is left then it is just before the EOF. Anyone have a better method?
I need to search a file for a certain characters and report were it is in the file. I need too test if the characers are the ones just before the EOF or not.
How can I find the max offset?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXCHAR 2048 //number of characters to read from disk
Thanx
A jpeg EOF is FFD9 does c recognise marker or does it's EOF happen because EOF is reached
So if I added something after FFD9 would it be read by reading a file until EOF or would EOF be called on...
Does the EOF in binary mode read untill it gets to the file EOF or the real end of the file(REOF).
EXAMPLE
DATAEOFJUNKREOF
Thank you for all your help
Like this, the code still does not access directories inside the other
#include <unistd.h>
#include <stdio.h>
#include <dirent.h>
#include <string.h>
#include <sys/stat.h>
would fopen (entry->d_name, "rb") work?
I want to be able to tell another code chunk what the file is and too perform stuff on it
I have the following code:
void printdir( )
{
DIR *dp;
struct dirent *entry;
struct stat statbuf;
int depth = 0;
A known stego program encrypts the headet of a bmp file. I want to write an application that can detect this.
I am creating a stego detection program.
Does anyone know how I could detect encryption in a bmp header?
This code on running against any bitmap keeps generating a segmentation fault
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
typedef struct _bmp_header
{
char ID[2];
int size;
char res1[2], res2[2];
All done logic does not seem to be working though.
Thank you, down too this many errors now
SDetect.c: In function `main':
SDetect.c:87: `BMPinfo' undeclared (first use in this function)
SDetect.c:87: (Each undeclared identifier is reported...
SDetect.c: In function `main':
SDetect.c:51: parse error before '{' token
SDetect.c:57: case label not within a switch statement
SDetect.c:60: case label not within a switch statement...
Sorry about the standard of the last code this is a cleaned up version still has some error in it though.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
...
Been codeing all night can't seem to find the errors in this code. I expect they are obvious but can't see them with tired eyes. Using gcc for Cygwin as complier
/* This is a program that...
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <errno.h>
extern errno;
#define SEMPERM 0600
I am having difficulty with my IPC producer consumer program.
if ((shmid=shmget(KEY, sizeof(struct shseg), IPC_CREAT|0666|IPC_EXCL ==-1){
if (errno==EEXIST) {
}
}
...
Haveing problem with this code, the program computes basic statistic on a single file.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
...
Thanx I think I will go with to directory's any chance of help in trying to display file size, permissions etc
I currently have this code:
void printdir(char *dir, int depth)
{
DIR *dp;
struct dirent *entry;
struct stat statbuf;
FILE *file; /* declare a FILE pointer */