Subject: afpd tools

From: [email-masked] (Patrick Asty)
Date: Mon, 21 Feb 94 14:34:55 +0100

I am looking for Unix tools to populate unix afpd directories:

I think it is always possible to create - from Unix - directories & files in a
unix afpd directory: when they are accessed under MacOs, all is ok.

Am I right ?

But I notice it is not possible to delete - from Unix - directories & files in a
unix afpd directory: the .AppleDouble have to be modified.

Does anybody make such tools (a sort of afpmkdir afprmdir afpcp afprm ...) ?

I would like to develop such tools but I don't know exactely what to do in the
..AppleDouble & .Parent directories & files.

Does anybody have these informations ?

=============================================================================
Patrick ASTY                                        Email        [email-masked]
CR2A
19, Avenue Dubonnet                                 Tel   +33 (1) 47 68 97 97
92411 Courbevoie Cedex                              Fax   +33 (1) 47 68 87 81

---

From: Charles Clark <[email-masked]>
Date: Tue, 22 Feb 94 10:08:59 EST

> From:     [email-masked] (Patrick Asty)

> unix afpd directory: when they are accessed under MacOs, all is ok.

This should be true.

> Does anybody make such tools (a sort of afpmkdir afprmdir afpcp afprm ...) ?

I wrote "tc" once (stands for trash can, of course); but it wasn't
quite up to rm standards.  I don't think I have the most evolved
version of it around anymore even.

alias afprmdir 'rm -r'

> ..AppleDouble & .Parent directories & files.

All you really need to do when you delete a file is to delete the
exact same filename in the .AppleDouble directory; ie to delete
"/usr/local/mac/Font:2fDA Mover 4.1" then also delete
"/usr/local/mac/.AppleDouble/Font:2fDA Mover 4.1" (if it exists).  To
delete a directory, you just can do "rm -r" on the directory.

I believe if you copy a file, and you copy the relevant .AppleDouble
part of the file to the .AppleDouble directory in the new place, it
should work fine, but I'm not SURE that there is no weirdness in this
case.  (If there were, it should be nothing a clean up by name or some
such from the mac wouldn't handle).

--
cmclark

---

From: [email-masked]
Date: Tue, 22 Feb 1994 10:28:58 -0500

> From:    Charles Clark <[email-masked]>
> To:      [email-masked] (Patrick Asty)

> To delete a directory, you just can do "rm -r" on the directory.

Actually, it would be better to make afprmdir a script like

    #!/bin/sh

    if [ -d "$1/.AppleDouble ]; then
	if [ -f "$1/.AppleDouble/.Parent" ]; then
	    rm "$1/.AppleDouble/.Parent"
	fi
	rmdir "$1/.AppleDouble"
    fi
    rmdir "$1"

but with good argument processing.  This way, you get the correct error
messages, e.g. when the directory isn't empty, you don't merrily remove
everything anyway.

:wes