[net.micro.mac] how to rename a volume with a toolbox call?

guido@boring.UUCP (07/24/85)

Can anyone explain me how I can rename a Volume (= disk) using some
toolbox call from within an application I'm writing (in C)?

Inside Macintosh suggests that this is possible using Rename or PBRename,
and I've tried the first, but it keeps complaining about "file not found"
(error 43).  It seems to me that the call would be ambiguous if it can
be used to rename files as well as volumes, unless there is some
special value to ass as old name.  PBRename has exactly the same,
too vague, description.

Since the Finder seems to know how to do it, it must be possible
(and I hope without writing directly to the disk).

If you can shed light on this problem, thanks in advance.  Mail is fine.

Guido van Rossum, CWI, Amsterdam  ...!{decvax,philabs,seismo}!mcvax!guido

lsr@apple.UUCP (Larry Rosenstein) (07/30/85)

In article <6531@boring.UUCP> guido@mcvax.UUCP (Guido van Rossum) writes:
>Can anyone explain me how I can rename a Volume (= disk) using some
>toolbox call from within an application I'm writing (in C)?
>
>Inside Macintosh suggests that this is possible using Rename or PBRename,
>and I've tried the first, but it keeps complaining about "file not found"
>(error 43).

I haven't tried this personally, but I believe that the trick is to
specify the old/new volume name with a colon; eg., 'quux:' rather
than 'quux'.  (This is how the system differenciates between renaming
a file and renaming a volume.)

You can also specify the source volume by refnum, rather than by name.

guido@boring.UUCP (07/30/85)

In article <6531@boring.UUCP> I wrote:
>Can anyone explain me how I can rename a Volume (= disk) using some
>toolbox call from within an application I'm writing (in C)?

Today the answer came by mail from seismo!ihnp4!spuxll!ech (=Ned=):
use [PB]Rename, appending a colon (:) to both the old and the new name.

Apple, please listen: it was absolutely impossible to deduce this from
inside Macintosh.  Could someone clarify this passage in the next version?

	Guido van Rossum, CWI, Amsterdam (guido@mcvax.UUCP)

rick@sara70.UUCP (Rick Jansen) (07/31/85)

[Share and enjoy]
 
File Manager manual page 4:
" You identify a volume by its *volume name*, which consists of any sequence of 1 to 27 printing characters. Volume names must always be followed by a colon 
(:)...".
 
So, it seems not to be impossible to deduce this from Inside Macintosh.
(Perhaps they should print "Don't Panic" on the cover in large friendly
letters and make it slightly cheaper...)
 
Rick Jansen
{seismo,decvax,philabs}!mcvax!sara70!rick