Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Create resource fork from windows.

27 views
Skip to first unread message

Dave Allen

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
Hello all,
I have a MAC shared volume on an NT server. I would like to add resource forks to to files
created on the PC's to ease the problems of MAC users double clicking and opening the wrong
application.

Is the resource fork a separate file or just added on to the end of a file after the EOF
marker ? I know the IDs to be used, not how to add them from a PC program.

Any help would be appreciated.
Please email to dal...@symbology.com

Thanks
Dave Allen

T. Colin Mack

unread,
Mar 5, 1999, 3:00:00 AM3/5/99
to
> I have a MAC shared volume on an NT server. I would like to add resource
forks to to files
> created on the PC's to ease the problems of MAC users double clicking and
opening the wrong
> application.

This sounds like it might be a bit of a hassle since your program would need
to be constantly running and modify new PC files after they are saved, etc.
without getting in the way of people who want to use the files.

If it is an option for you, I would suggest using the File Exchange control
panel on the macs to set up the mapping of windows file extensions to
mac file type/creator values. If there are a lot of macs you need to
maintain, I believe you could just do the set up on one machine, and then
put a copy of that machine's File Exchange preference file into the
System/Preferences folder of all the other macs.

Good luck,

Colin
------------------------
T. Colin Mack
Satelight, Inc.
Sapporo, Japan
www.satelight.co.jp
------------------------

Adam

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to

Dave Allen <dal...@symbology.com> wrote in article
<36DEA4A9...@symbology.com>...
> Hello all,


> I have a MAC shared volume on an NT server. I would like to add
resource forks to to files
> created on the PC's to ease the problems of MAC users double clicking and
opening the wrong
> application.
>

> Is the resource fork a separate file or just added on to the end of a
file after the EOF
> marker ? I know the IDs to be used, not how to add them from a PC
program.
>

I don't know if this would work for you, but when i move floppies (PC
formatted) back and forth from my mac, I simply create a subdirectory
called "Resource.frk". the resource fork of each file is stored as a
seprate file with the same name in the resource.frk directory. the resource
directory must be a subdirectory of the file's parent directory. This is
very convienient because it allows the files to be modified on the pc end
without changing the resource fork.

i have no idea what the format of these resource files are.

---
adam

cro...@my-dejanews.com

unread,
Mar 25, 1999, 3:00:00 AM3/25/99
to
I have no knowledge about the way your NT server stores the resource
forks, but many unix servers (e.g. Netatalk) use AppleDouble format.
Several years ago I wrote a utility to do what you need for
.AppleDouble format resource forks called "macify" at
http://bul.eecs.umich.edu/~crowej/index2.html.

If your server doesn't use .AppleDouble format (very likely something
else) and you can't find a suitable utility for that format, you
could easily modify macify for your needs.

In article <01be7151$02727de0$d73bbbcc@default>,


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

cro...@my-dejanews.com

unread,
Mar 25, 1999, 3:00:00 AM3/25/99
to

cro...@umich.edu

unread,
Mar 25, 1999, 3:00:00 AM3/25/99
to
I have no knowledge about the way your NT server stores the resource
forks, but many unix servers (e.g. Netatalk) use AppleDouble format.
Several years ago I wrote a utility to do what you need for
.AppleDouble format resource forks called "macify" at
http://bul.eecs.umich.edu/~crowej/index2.html.

If your server doesn't use .AppleDouble format (very likely something
else) and you can't find a suitable utility for that format, you

could modify macify for your needs.

Lord Apollyon

unread,
Apr 3, 1999, 3:00:00 AM4/3/99
to
In article <36DEA4A9...@symbology.com>, Dave Allen
<dal...@symbology.com> wrote:

> Is the resource fork a separate file or just added on to the end of a
> file after the EOF marker ?
> I know the IDs to be used, not how to add them from a PC program.

Well, it's LIKE a separate file (for the purposes of NT). The structure
of it however is something definitely best left to a Macintosh to create.

If you don't alter the length of the resource data, you *CAN* make changes
to the resource contents (say, like version numbers, etc). But altering
the resource type, id, sizes, etc, you have to work out the resource fork
formats, and be VERY VERY anal about conforming to it. Damaged resource
forks can cause lockups, data loss, etc. (Imagine a CODE 0 resource that
the system thinks is 2.8GB in size :) )

Anyhow... if you're really after this, what I suggest is this:

1) Make all of your resources and such on a Macintosh. If you want the PC
to alter some of the contents (like a vers version value, or whatever),
make sure you reserve all the space within them that you need.

2) Copy the file to your NT server. There should be a directory called
"resource.frk" which has the resource forks for all of the Macintosh files
which possess them.

At this point, you may wish to use Norton Disk Editor or other HEX File
Editing tool to search for the offsets of the data you might with to
alter. Note the file offsets carefully.

3) Alter the data forks at will. If you need to alter the resource fork
data, you can do that.

If you wish to "create on demand" a resource fork for a bunch of files,
I'd make a template using the technique I just described. Do not attempt
to create the resource forks on your own, unless you're willing to spend
lots of time going through all relevant documentation on the resource fork
file, lots of testing, etc. I recall many years ago some commercial
software houses used to try to generate resource forks on a non-Macintosh
- there were some embarrassing booboos with corrupted resource forks and
data. They discontinued the practice. :) Besides, Apple's been
threatening to change the file's format for quite some time now.

=R=

--
Save money and retain control of your embedded cross-assembler tools!
Use Alfred Arnold's excellent universal cross-assembler, ASX.
Available from: <ftp://john.ccac.rwth-aachen.de/pub/as/>
Mirror: ftp://www4.au.freebsd.org/pub/uP/xass-family.arnold/
ftp://www4.au.freebsd.org/pub/uP/xass-family.arnold/c_version

Jeff Johnson

unread,
Apr 21, 1999, 3:00:00 AM4/21/99
to

Dave Allen <dal...@symbology.com> wrote in message
news:36DEA4A9...@symbology.com...

> Hello all,
> I have a MAC shared volume on an NT server. I would like to add
resource forks to to files
> created on the PC's to ease the problems of MAC users double clicking and
opening the wrong
> application.
>
> Is the resource fork a separate file or just added on to the end of a
file after the EOF
> marker ? I know the IDs to be used, not how to add them from a PC
program.

You're in luck: I just got something related to this working last weekend!

NTFS has the concept of "streams." With streams, the same file can contain
multiple sets of data. This is how NT emulates resource forks. The data you
see in Explorer is stored in the default, unnamed stream. Mac resource data
is stored in a stream named AFP_Resource. Streams are indicated by appending
a colon (:) and the stream name to the end of the file. For example, you
could have two streams in a text file:

MyTextFile.txt
MyTextFile.txt:NewStream

Some commands will work with streams, such as ECHO and MORE, but
unfortunately COPY doesn't support them, which is probably the only command
that absolutely SHOULD. Oh, well.

The best way to put data in another stream from an existing file is with the
CopyFileEx() API. CreateFile() also supports streams, if you want to write
data yourself. These APIs are much safer than using a disk editor.

Brian Fitzgerald

unread,
Apr 22, 1999, 3:00:00 AM4/22/99
to

On Wed, 21 Apr 1999 7:21:02 -0700, Jeff Johnson wrote
(in message <O8lT2.3852$Bm3.2...@news20.ispnews.com>):

> You're in luck: I just got something related to this working last weekend!
>
> NTFS has the concept of "streams." With streams, the same file can contain
> multiple sets of data. This is how NT emulates resource forks. The data you
> see in Explorer is stored in the default, unnamed stream. Mac resource data
> is stored in a stream named AFP_Resource. Streams are indicated by
> appending a colon (:) and the stream name to the end of the file. For
> example, you could have two streams in a text file:
>
> MyTextFile.txt MyTextFile.txt:NewStream
>
> Some commands will work with streams, such as ECHO and MORE, but
> unfortunately COPY doesn't support them, which is probably the only command
> that absolutely SHOULD. Oh, well.
>
> The best way to put data in another stream from an existing file is with
> the CopyFileEx() API. CreateFile() also supports streams, if you want to
> write data yourself. These APIs are much safer than using a disk editor.

This is very useful! Thanks!

Is there a way to enumerate all the streams that an NTFS file has? I've been
probing through the MSDN library, to little avail.

--
Brian Fitzgerald
Future Point

Jeff Johnson

unread,
Apr 22, 1999, 3:00:00 AM4/22/99
to

Brian Fitzgerald <bf...@acm.org> wrote in message
news:01HW.B344DB630...@news.giganews.com...

> This is very useful! Thanks!
>
> Is there a way to enumerate all the streams that an NTFS file has? I've
been
> probing through the MSDN library, to little avail.

Uh, maybe....

Actually I don't know, but I got the original information from someone in
the Windows networking newsgroup. Don't remember his name or his website,
but one of the things that was mentioned on his page was the BackupRead API.

If you do happen to find out an easy way, let me know. I'm going to design a
simple program for a specific task: using Windows NT to copy files written
by a Mac onto a FAT-formatted disk into an SFM volume. (Whew!) In English,
when a Mac writes to a FAT disk, it puts the resource data into a sub-folder
called RESOURCE.FRK (which you already know). Now a Mac can easily read this
disk and copy the file onto an NT SFM volume with everything intact, but NT
itself can't. My program will allow NT to do so. I'll send it to you if
you'd find it useful.

0 new messages