From 35a8a43ba66e1e5ffdff0a283e398a6a1fc13a54 Mon Sep 17 00:00:00 2001 From: Mats Behre Date: Wed, 28 Jun 2017 22:48:09 -0400 Subject: POSIX compliant resource fork access. --- fondu.c | 4 ++-- frommacbinary.c | 2 +- lumper.c | 4 ++-- res2data.c | 4 ++-- setfondname.c | 4 ++-- showfond.c | 4 ++-- tomacbinary.c | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fondu.c b/fondu.c index e98c913..46e95e1 100644 --- a/fondu.c +++ b/fondu.c @@ -940,12 +940,12 @@ return( true ); #ifndef OldMacintosh /* OS/X and linux with appropriate drivers */ static int HasResourceFork(char *filename,PSFONT *psfont) { - char *respath = malloc(strlen(filename)+strlen("/rsrc")+1); + char *respath = malloc(strlen(filename)+strlen("/..namedfork/rsrc")+1); FILE *temp; int ret=false; strcpy(respath,filename); - strcat(respath,"/rsrc"); + strcat(respath,"/..namedfork/rsrc"); temp = fopen(respath,"r"); free(respath); if ( temp!=NULL ) { diff --git a/frommacbinary.c b/frommacbinary.c index 5247b47..6657dc9 100644 --- a/frommacbinary.c +++ b/frommacbinary.c @@ -158,7 +158,7 @@ return; if ( rlen>0 ) { fseek(binfile,128 + ((dlen+127)&~127),SEEK_SET); - strcpy(name+header[1],"/rsrc"); + strcpy(name+header[1],"/..namedfork/rsrc"); resfile = fopen(name,"w"); if ( resfile==NULL ) fprintf( stderr, "Cannot open output file: %s\n", name ); diff --git a/lumper.c b/lumper.c index 39164e2..18ff301 100644 --- a/lumper.c +++ b/lumper.c @@ -501,12 +501,12 @@ static int HasResourceFork(char *filename) { /* If we're on a mac, we can try to see if we've got a real resource fork */ /* linux has an HFS+ driver (or whatever) too, so we might as well always */ /* do this check */ - char *respath = malloc(strlen(filename)+strlen("/rsrc")+1); + char *respath = malloc(strlen(filename)+strlen("/..namedfork/rsrc")+1); FILE *temp; int ret = false; strcpy(respath,filename); - strcat(respath,"/rsrc"); + strcat(respath,"/..namedfork/rsrc"); temp = fopen(respath,"r"); free(respath); if ( temp!=NULL ) diff --git a/res2data.c b/res2data.c index 7709229..d0d95ba 100644 --- a/res2data.c +++ b/res2data.c @@ -42,9 +42,9 @@ static int ToResourceFork(char *filename) { FILE *res, *temp; int cnt; - respath = malloc(strlen(filename)+strlen("/rsrc")+1); + respath = malloc(strlen(filename)+strlen("/..namedfork/rsrc")+1); strcpy(respath,filename); - strcat(respath,"/rsrc"); + strcat(respath,"/..namedfork/rsrc"); res = fopen(respath,"r"); free(respath); diff --git a/setfondname.c b/setfondname.c index 5e2f14d..fa84f89 100644 --- a/setfondname.c +++ b/setfondname.c @@ -167,12 +167,12 @@ static int HasResourceFork(char *filename) { /* If we're on a mac, we can try to see if we've got a real resource fork */ /* linux has an HFS+ driver (or whatever) too, so we might as well always */ /* do this check */ - char *respath = malloc(strlen(filename)+strlen("/rsrc")+1); + char *respath = malloc(strlen(filename)+strlen("/..namedfork/rsrc")+1); FILE *temp; int ret = false; strcpy(respath,filename); - strcat(respath,"/rsrc"); + strcat(respath,"/..namedfork/rsrc"); temp = fopen(respath,"r+"); free(respath); if ( temp!=NULL ) { diff --git a/showfond.c b/showfond.c index 47890ac..8e62fda 100644 --- a/showfond.c +++ b/showfond.c @@ -619,12 +619,12 @@ static int HasResourceFork(char *filename) { /* If we're on a mac, we can try to see if we've got a real resource fork */ /* linux has an HFS+ driver (or whatever) too, so we might as well always */ /* do this check */ - char *respath = malloc(strlen(filename)+strlen("/rsrc")+1); + char *respath = malloc(strlen(filename)+strlen("/..namedfork/rsrc")+1); FILE *temp; int ret = false; strcpy(respath,filename); - strcat(respath,"/rsrc"); + strcat(respath,"/..namedfork/rsrc"); temp = fopen(respath,"r"); free(respath); if ( temp!=NULL ) { diff --git a/tomacbinary.c b/tomacbinary.c index 8e7dc5b..5650b11 100644 --- a/tomacbinary.c +++ b/tomacbinary.c @@ -50,7 +50,7 @@ /* MacBinary files use the same CRC that binhex does (in the MacBinary header) */ extern unsigned long binhex_crc(unsigned char *buffer,int size); -/* the resource fork may be opened (on Mac OS/X) by /rsrc */ +/* the resource fork may be opened (on Mac OS/X) by /..namedfork/rsrc */ /* tobin [-res rfilename] filename {[-res filename] rfilename} */ @@ -81,11 +81,11 @@ static void Usage(char *prog) { static FILE *ResForkOfDataFile(char *dataname) { #ifndef OldMacintosh /* OS/X and linux with appropriate drivers */ - char *respath = malloc(strlen(dataname)+strlen("/rsrc")+1); + char *respath = malloc(strlen(dataname)+strlen("/..namedfork/rsrc")+1); FILE *temp; strcpy(respath,dataname); - strcat(respath,"/rsrc"); + strcat(respath,"/..namedfork/rsrc"); temp = fopen(respath,"r"); free(respath); return( temp ); -- cgit v1.2.3