[OS X TeX] Bug in TeXShop 1.34?

Juan Manuel Palacios jmpalaciosp at eml.cc
Sun Mar 28 09:23:30 CEST 2004


On Mar 26, 2004, at 6:04 PM, Bob Kerstetter wrote:

> I don't believe TeXShop creates a resource fork? Does it, Dick, if you 
> are listening!?!?
>

	Hi Bob. Richard already answered your question about TeXShop and 
resource forks, but in any case I thought I could share this 
interesting tip I learned recently. Many times I've said publicly on 
this list I would dedicate a fairly long message to sharing interesting 
UNIX tips I learn as I go along, but lack of time has always beheaded 
dead my promises... since this is a small one I don't need much 
preamble, so here it goes :-)

	If you want to know if a file has a resource fork you can use nothing 
more but old trusty "ls" to find out. Using a "ParaleloLab4.tex" 
TeXShop file as an initial example:

$[juan at PowerBook: Universidad](209/0,0)-> ls ParaleloLab4.tex
-rw-r--r--  1 juan  staff    3K 11 Oct 13:03 ParaleloLab4.tex

	This is the long listing produced for that file with ls -l (which is 
aliased to plain "ls" in my box). Now, take a look at the magical part:

$[juan at PowerBook: Universidad](211/0,0)-> ls ParaleloLab4.tex/rsrc
-rw-r--r--  1 juan  staff  0B 11 Oct 13:03 ParaleloLab4.tex/rsrc

	See that?!! Hehe, all I did is append "/rsrc" to the file name and "ls 
-l" produced the listing of its resource fork. As TeXShop does not 
implement them, the listing has a "0B" size (shown right after the 
"staff" group). Now, lets take a look at a file *with* a resource fork 
(gee... let me see if I can find one first, I've made a point of 
stripping them out of practically every file in my box... OK, Quark!):

$[juan at PowerBook: CDP](222/0,0)-> ls Factura
-rw-r--r--  1 juan  wheel    151K  5 Mar 13:45 Factura

$[juan at PowerBook: CDP](223/0,0)-> ls Factura/rsrc
-rw-r--r--  1 juan  wheel    1K  5 Mar 13:45 Factura/rsrc

	See? Here the file "Factura" (meaning "Invoice" in English) has a 1K 
resource fork, revealed by its "/rsrc" long listing. So, you don't 
reallly need any 3rd party tools apart from the ones that already ship 
with your mac to deal with resource forks. To see the characteristics 
of the resource fork I just presented, I can use "lsmac" (at first I 
thought it shipped with the Developer Tools, but as I didn't find it 
there I installed it through DarwinPorts --the "osxutils" port--):

$[juan at PowerBook: CDP](244/0,0)-> lsmac
------  XPRJ XPR3  152.3 KB  Factura

	There you'd see resource fork flags like "File is Invisible", "Is a 
bundle", "Has a custom icon" and others but this file has none set, 
which is the reason for the leading ---- in the listing. Finder info 
like type and creator codes (wrongfully associated with the resource 
fork)  can be seen with "GetFileInfo" (this one *is* from the Developer 
Tools package):

$[juan at PowerBook: CDP](246/0,0)-> GetFileInfo Factura
file: "Factura"
type: "XPRJ"
creator: "XPR3"
attributes: avbstclinmed
created: 03/05/2004 13:45:21
modified: 03/05/2004 13:45:22

	"And what if I want to get rid of the resource fork?" you may ask... 
Well, trusty old "tar" always comes to the rescue:

$[juan at PowerBook: CDP](256/0,0)-> tar cvf f.tar Factura
Factura

$[juan at PowerBook: CDP](257/0,0)-> rm Factura
remove Factura? y
Factura

$[juan at PowerBook: CDP](258/0,0)-> tar xvf f.tar
Factura

$[juan at PowerBook: CDP](259/0,0)-> ls Factura
-rw-r--r--  1 juan  staff    151K  5 Mar 13:45 Factura

$[juan at PowerBook: CDP](260/0,0)-> ls Factura/rsrc
-rw-r--r--  1 juan  staff  0B  5 Mar 13:45 Factura/rsrc

	There I just created an simple tar archive containing the file, then I 
deleted the original and re-extracted it from the archive to show you 
that the resource fork is gone, as shown by the last "/rsrc" listing. 
This happens because "tar" is completely unaware of resource forks, so 
when it access files to include them in an archive it only looks for 
the data fork, leaving behind everything else.

	Well, hope these tips are useful and entertaining! Have fun playing 
with your resource forks from the command line. Personally I believe 
Apple is moving away from them (though they were a really good idea at 
the moment), so I always advice against using them or dealing with 
applications that rely on them; unfortunately Quark still does (they 
always seem to be behind at everything) but I rely on it for this 
specific set of files :-(  What can I say ...?

	Have a good evening,...


		Juan





-----------------------------------------------------
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the macostex-archives mailing list