augustss@chalmers.UUCP (Lennart Augustsson) (01/25/85)
[] Here's a small fix to macput to enable you to set the bundle flag when downloading a file. Since the faked info (macput -r) doesn't contain it normally you have to set it yourself to get your own icon or whatever. But now just use macput -r -b. *** macput.c.old Sat Jan 3 00:59:16 1985 --- macput.c Sat Jan 5 19:39:36 1985 *************** *** 2,8 #include <signal.h> #include <setjmp.h> #include <sgtty.h> ! #include <time.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/timeb.h> --- 2,8 ----- #include <signal.h> #include <setjmp.h> #include <sgtty.h> ! #include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/timeb.h> *************** *** 35,40 /* 65 <-> 80 is the FInfo structure */ #define H_TYPEOFF 65 #define H_AUTHOFF 69 #define H_LOCKOFF 81 #define H_DLENOFF 83 --- 35,42 ----- /* 65 <-> 80 is the FInfo structure */ #define H_TYPEOFF 65 #define H_AUTHOFF 69 + #define H_FLAGOFF 73 + #define F_BUNDLE 32 #define H_LOCKOFF 81 #define H_DLENOFF 83 *************** *** 52,57 int mode, txtmode; int pre_beta; /* -o flag; for compatibility with MacTerminal Version -0.15X */ struct macheader { char m_name[NAMEBYTES+1]; --- 54,60 ----- int mode, txtmode; int pre_beta; /* -o flag; for compatibility with MacTerminal Version -0.15X */ + int bundleflag; /* set bundle flag in faked info */ struct macheader { char m_name[NAMEBYTES+1]; *************** *** 85,91 * revised ddj 7/31/84 -- fixed timeout problem in initial handshake */ char usage[] = ! "usage: \"macput [-o] [-rdu] [-t type] [-a author] [-n name] filename\"\n"; main(ac, av) char **av; --- 88,94 ----- * revised ddj 7/31/84 -- fixed timeout problem in initial handshake */ char usage[] = ! "usage: \"macput [-o] [-brdu] [-t type] [-a author] [-n name] filename\"\n"; main(ac, av) char **av; *************** *** 103,108 while (ac) { if (av[0][0] == '-') { switch (av[0][1]) { case 'r': mode = RSRC; strncpy(mh.m_type, "APPL", 4); --- 106,114 ----- while (ac) { if (av[0][0] == '-') { switch (av[0][1]) { + case 'b': + bundleflag++; + break; case 'r': mode = RSRC; strncpy(mh.m_type, "APPL", 4); *************** *** 262,267 strncpy(buf + H_NAMEOFF, mh.m_name, n); strncpy(buf + H_TYPEOFF, mh.m_type, 4); strncpy(buf + H_AUTHOFF, mh.m_author, 4); if (pre_beta) { put4(buf + H_OLD_DLENOFF, mh.m_datalen); put4(buf + H_OLD_RLENOFF, mh.m_rsrclen); --- 268,275 ----- strncpy(buf + H_NAMEOFF, mh.m_name, n); strncpy(buf + H_TYPEOFF, mh.m_type, 4); strncpy(buf + H_AUTHOFF, mh.m_author, 4); + if (bundleflag) + buf[H_FLAGOFF] |= F_BUNDLE; if (pre_beta) { put4(buf + H_OLD_DLENOFF, mh.m_datalen); put4(buf + H_OLD_RLENOFF, mh.m_rsrclen); -- Any resemblance of the opinions above to real opinions, living or dead, is purely coincidential. Lennart Augustsson {seismo,philabs,decvax}!mcvax!enea!chalmers!augustss