Skip to content

Fix file open messages to be more informative #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/scaff_BC-reads-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,17 @@ int main(int argc, char **argv)
nseq=0;
if((namef = fopen(argv[args],"r")) == NULL)
{
printf("ERROR main:: alignment file 2 \n");
perror("ERROR main:: input read_1 file");
exit(1);
}
if((namef2 = fopen(argv[args+1],"w")) == NULL)
{
printf("ERROR main:: alignment file 2 \n");
perror("ERROR main:: output read_1 file");
exit(1);
}
if((namef3 = fopen(argv[args+2],"w")) == NULL)
{
printf("ERROR main:: alignment file 2 \n");
perror("ERROR main:: output name_1 file");
exit(1);
}

Expand Down
23 changes: 13 additions & 10 deletions src/scaff_BC-reads-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int main(int argc, char **argv)
nseq=0;
if((namef = fopen(argv[args],"r")) == NULL)
{
printf("ERROR main:: args \n");
perror("ERROR main:: input name_1 file");
exit(1);
}
while(!feof(namef))
Expand All @@ -166,14 +166,17 @@ int main(int argc, char **argv)

if((read_index = (int *)calloc(nseq,sizeof(int))) == NULL)
{
printf("fmate: calloc - ctg_left\n");
perror("fmate: calloc - ctg_left");
exit(1);
}
if((R_Name = cmatrix(0,nseq+10,0,Max_N_NameBase)) == NULL)
{
exit(1);
}
R_Name = cmatrix(0,nseq+10,0,Max_N_NameBase);

if((namef = fopen(argv[args],"r")) == NULL)
{
printf("ERROR main:: args \n");
perror("ERROR main:: input name_2 file");
exit(1);
}
/* read the alignment files */
Expand All @@ -188,12 +191,12 @@ int main(int argc, char **argv)
nseq=0;
if((namef = fopen(argv[args+1],"r")) == NULL)
{
printf("ERROR main:: alignment file 2 \n");
perror("ERROR main:: input read_2 file");
exit(1);
}
if((namef2 = fopen(argv[args+2],"w")) == NULL)
{
printf("ERROR main:: alignment file 2 \n");
perror("ERROR main:: out read_2 file");
exit(1);
}

Expand Down Expand Up @@ -938,7 +941,7 @@ int **imatrix(long nrl,long nrh,long ncl,long nch)
/* allocate pointers to rows */
if((m=(int **)calloc(nrow,sizeof(int*)))==NULL)
{
printf("error imatrix: calloc error No. 1 \n");
perror("error imatrix: calloc error No. 1");
return(NULL);
}
m+=0;
Expand All @@ -947,7 +950,7 @@ int **imatrix(long nrl,long nrh,long ncl,long nch)
/* allocate rows and set pointers to them */
if((m[nrl]=(int *)calloc(nrow*ncol,sizeof(int)))==NULL)
{
printf("error imatrix: calloc error No. 2 \n");
perror("error imatrix: calloc error No. 2");
return(NULL);
}
m[nrl]+=0;
Expand All @@ -968,7 +971,7 @@ char **cmatrix(long nrl,long nrh,long ncl,long nch)
/* allocate pointers to rows */
if((cm=(char **)calloc(nrow,sizeof(char*)))==NULL)
{
printf("error cmatrix: calloc error No. 1 \n");
perror("error cmatrix: calloc error No. 1");
return(NULL);
}
cm+=0;
Expand All @@ -977,7 +980,7 @@ char **cmatrix(long nrl,long nrh,long ncl,long nch)
/* allocate rows and set pointers to them */
if((cm[nrl]=(char *)calloc(nrow*ncol,sizeof(char)))==NULL)
{
printf("error cmatrix: calloc error No. 2 \n");
perror("error cmatrix: calloc error No. 2");
return(NULL);
}
cm[nrl]+=0;
Expand Down