diff options
author | Mats Behre <mb.maillists@gmail.com> | 2017-06-28 22:48:09 -0400 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2017-06-28 22:48:09 -0400 |
commit | 35a8a43ba66e1e5ffdff0a283e398a6a1fc13a54 (patch) | |
tree | e7752d5bc633fd9875952332adbea68139c780b8 | |
parent | 399ea0471284c2433999fbcb2a2df6fa037fbaf2 (diff) |
POSIX compliant resource fork access.
-rw-r--r-- | fondu.c | 4 | ||||
-rw-r--r-- | frommacbinary.c | 2 | ||||
-rw-r--r-- | lumper.c | 4 | ||||
-rw-r--r-- | res2data.c | 4 | ||||
-rw-r--r-- | setfondname.c | 4 | ||||
-rw-r--r-- | showfond.c | 4 | ||||
-rw-r--r-- | tomacbinary.c | 6 |
7 files changed, 14 insertions, 14 deletions
@@ -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 ); @@ -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 ) @@ -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 ) { @@ -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 <filename>/rsrc */ +/* the resource fork may be opened (on Mac OS/X) by <filename>/..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 ); |