Subject: Re: AppleDouble ftpd?

From: "Stefan Bethke" <[email-masked]>
Date: 24 Jan 1996 10:05:07 +0200

Subject:  RE>AppleDouble ftpd?

I also thought this would be nice.

As a first approximation, it should be possible to use wuftp's on-the-fly conversion (see ftpconversions(5)); at least, this would allow a user to request "file.bin" and get "file" converted from AppleDouble to MacBinary.

Unfortunatly, I think most Mac users (Fetch, Anarchie) don't know about on-the-fly-conversion and will always get "file" from the server by double-clicking in the directory window, so this hack might be of little practical use.

Best regards
Stefan Bethke

--
Promo Datentechnik      |  Tel. +49-40-431360-0
+ Systemberatung GmbH   |  Fax. +49-40-431360-60
Waterloohain 6-8        |  e-mail: [email-masked]
D-22769 Hamburg         |  http://www.Promo.DE/
--------------------------------------
Date: 24.01.1996 2:07 Uhr
To: Stefan Bethke
From: [email-masked]

  I would like an ftpd that can recognize netatalk's .AppleDouble directories
and serve the files to Fetch or Anarchie in MacBinary or AppleSingle format.

	The purpose is to be able to provide the mac files on my netatalk
volume to people not on my local network.

	Does such a thing exist?  Patches to wuftpd would be bonus, but I'm not
getting my hopes up. 

-Bill

---

From: Charles Clark <[email-masked]>
Date: Thu, 25 Jan 1996 00:03:54 -0500 (EST)

On 24 Jan 1996, Stefan Bethke wrote:

> As a first approximation, it should be possible to use wuftp's
> on-the-fly conversion (see ftpconversions(5)); at least, this would
> allow a user to request "file.bin" and get "file" converted from
> AppleDouble to MacBinary.

Assuming you have a program to do the conversion.

After looking at wuftpd, and the example conversion file (the man page
for ftpconversion(5) is a bit, how shall we say, sparse), it appears
that wuftpd does in fact hand the conversion program a filename and
expect it to write to stdout.

I think you'll need to define the program something like
:macbinary '%s': in the conversions file instead of just :macbinary %s:
in order to insure names with spaces work, in addition to getting me to 
make the "macbinary" form of megatron write to stdout.

You would then rely on user trying to "get" "filename.bin" when they see
"filename", instead of just clicking on "filename" from within Fetch (as
pointed out by Stefan Bethke, this isn't the most intuitive, obvious, or
point-and-click type of operation, such as a user with Fetch is used to).
Alternatively, you could hack wuftpd to use the macbinary conversion by
default, though that would make your ftpd pretty useless to any non-mac
clients.  Perhaps you could also hack wuftpd to accept some command that
would put it into this mode, which would be a bit more palatable. 

-- 
cmclark

---

From: "James H. Cloos Jr." <[email-masked]>
Date: Thu, 25 Jan 1996 03:06:49 -0600

>>>>> "Stefan" == "Stefan Bethke" <[email-masked]> writes:

Stefan> Unfortunatly, I think most Mac users (Fetch, Anarchie) don't
Stefan> know about = on-the-fly-conversion and will always get "file"
Stefan> from the server by = double-clicking in the directory window,
Stefan> so this hack might be of little = practical use.

The trick here is a hack to ls(1) that will display file.bin when both
file and .AppleDouble/file exist....

Implementation is left as an exercise for the reader....

-JimC
-- 
James H. Cloos, Jr.	<URL:http://www.io.com/~cloos/>
[email-masked]		LPF,Usenix,SAGE,ISOC

---

From: Andy Maas <[email-masked]>
Date: Thu, 25 Jan 1996 13:59:08 -0800 (PST)

A while ago I had similar idea but to do it on the client side. I had suggested
to Fetch author that when user select a file to download, Fetch can try to
check existance of .AppleDouble/<the same file name>. If that is true then
Fetch can (optionally prompt user for confirmation) to automatically get the
two forks and build the file locally on the mac. It should also look at
.AppleDesktop component for finderInfo (?)

Andy

---

From: Charles Clark <[email-masked]>
Date: Thu, 25 Jan 1996 17:17:59 -0500 (EST)

> .AppleDesktop component for finderInfo (?)

FinderInfo is completely stored in the .AppleDouble/filename part of the 
file.  If anyone is interested in writing code to convert netatalk style 
AppleDouble files, I can send you perhaps some advice and for sure some 
Doc on the file format.

Basically you want the Apple DTS doc defining AppleDouble Version One, 
and root around in bin/megatron/nad.c for the mtoupath routine for how we 
convert filenames to unix-legal names (basically the same routine can be 
found in ATALKSRCDIR/etc/afpd/desktop.c as well).  You can use the 
libatalk, but you don't need to, to convert afpd written files to 
something else.  If you want to write files that afpd will understand, 
you pretty much need to use libatalk, since afpd makes some assumptions 
when reading the AppleDouble file header that may not be valid in all 
files even if they conform to the AppleDouble V1 spec.  Using libatalk 
makes sure afpd will deal with them correctly.

The nad.c module of bin/megatron is one example (hey, don't laugh at it 
too much, I don't get paid to program/don't do too much of it) of reading 
and writing afpd compatible files.

-- 
cmclark