home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
utilfil
/
resdes.sit
/
rezdest.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-04
|
1KB
|
54 lines
/*
* Rezdest: Delete the resource fork of text files.
* An MPW Tool by
* Earle R. Horton Thursday, April 27, 1989
*
* MPW v. 2.0.2 compatibility alert: Pascal strings used to call
* Toolbox!!!!
*/
#include <stdio.h>
#include <files.h>
#include <CursorCtl.h>
main(argc, argv)
int argc;
char **argv;
{
int i;
int refnum;
FInfo info;
OSErr err;
int quiet = 0;
InitCursorCtl(nil);
for(i=1;i<argc;i++){
if(argv[i][0] == '-'){
switch(argv[i][1]){
case 'q':
case 'Q':
quiet = 1;
break;
default:
fprintf(stderr,"Usage: %s [-q] files.\r",argv[0]);
exit();
}
}else{
SpinCursor (32);
c2pstr(argv[i]);
GetFInfo(argv[i],0,&info);
if(info.fdType != 'TEXT'){
if(quiet == 0){
p2cstr(argv[i]);
fprintf(stderr,"\"%s\" is not a 'TEXT' file!\r",argv[i]);
}
}else{
if(!(err = OpenRF(argv[i],0,&refnum))){
SetEOF(refnum,0L);
FSClose(refnum);
}else{
p2cstr(argv[i]);
fprintf(stderr,"Open problem on %s\r",argv[i]);
}
}
}
}
}