[comp.sys.atari.st] Renaming folders

neil@hwcs.UUCP (06/08/88)

I have a folder 'ALCYON.C' on the HD here at work but I don't think Gulam
likes it because of the '.'. So today I decided to rename it by editing the
sector containing the directory entry (STOP!! No don't do it I hear you cry).

I suucessfully found the sector and changed the trailing 'C' into a space
($20) since that is what other folder entries had. But it didn't work.
Every time I tried to open that folder I was dumped back on the root of
the partition. Why? I tried a few different names like 'ALCYON_C', 'DEVKITCC' 
and 'ALCYONCC.DRI' and they all gave the same result. Only the original name
would yeild the correct result ie. a working folder.

A 32 byte directory entry looks like this:-
(I am relating this from the GEMDOS reference manual)

                          8 Character primary name
                         /
                        /        3 Character extension
                       /        /
 _____________________/  ______/   Attribute byte
/                     \ /      \  /
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
                  \___/ \___/ \___/ \_________/
                   \     \     \     \
                    \     \     \     File length
                     \     \     \ 
                      \     \     Starting cluster
                       \     \
                        \     Creation date
                         \
                          \
                           Creation time

All I changed was the name and extension. Nothing else. I hope the new ROM
Frename does a better job renaming folders than I did. I have since restored
the original folder name and its OK again. But I would like an explanation
as to what went wrong. Is there more to renaming a folder than just changing
its name?

-------------------------------------------------------------------------------
"I think all right thinking people in this country are sick and tired of being
told that ordinary decent people are fed up in this country with being sick and
tired. I'm certainly not and I'm sick and tired of being told that I am!"
- Monty Python

 Neil Forsyth                           JANET:  neil@uk.ac.hw.cs
 Dept. of Computer Science              ARPA:   neil@cs.hw.ac.uk
 Heriot-Watt University                 UUCP:   ..!ukc!cs.hw.ac.uk!neil
 Edinburgh
 Scotland
-------------------------------------------------------------------------------

"Russell_Stather.SBDERX"@XEROX.COM (06/17/88)

Neil,

You will probably find that rebooting after changing the name will work. The
problem is that GEMDOS maintains a list in RAM of folders so that it can speed
up access to them. Changing the name directly will therefore not update the RAM
copy.

Hope this helps 

Russell

neil@cs.hw.ac.uk (Neil Forsyth) (06/21/88)

In article <880617-013029-3945@Xerox> "Russell_Stather.SBDERX"@Xerox.COM writes
that my renaming a folder would work if I rebooted afterwards.

Yes it does work. Thanks to all who wrote and to Allen Pratt for severely
chastising me for attempting it in the first place. When a guy has to do
this sort of hacking regularly to recover the priceless (?) programs on the
students floppy disks one gets in to the habit of solving ones problems this
way.

 _____________________________________________________________________________
/ "I think all right thinking people in this country are sick and tired of    \
! being told that ordinary decent people are fed up in this country with      !
! being sick and tired. I'm certainly not and I'm sick and tired of being     !
! told that I am!" - Monty Python                                             !
!                                                                             !
! Neil Forsyth                           JANET:  neil@uk.ac.hw.cs             !
! Dept. of Computer Science              ARPA:   neil@cs.hw.ac.uk             !
! Heriot-Watt University                 UUCP:   ..!ukc!cs.hw.ac.uk!neil      !
! Edinburgh                                                                   !
! Scotland                                                                    !
\_____________________________________________________________________________/

Thomas_E_Zerucha@cup.portal.com (06/26/88)

One trick I used in a similar program was to write something that would
intercept the BIOS level call and return a false "Media Changed" after
changing the directory name and saving it - I used the Dfree call to see the
"changed media" and the intercept would detach itself after the first time.
It would always move back to the root and recognize the new directory.

apratt@atari.UUCP (Allan Pratt) (06/28/88)

I forget if it was listed here, but the new TOS ROMs can rename
directories using the Frename system call.  The desktop now lets you
edit the directory name when you "show info" on a directory, just like
on a file.  You can't use Frename to move directories around in the
tree, however, the way you can a file.  (I may fix that before the ROMs
go out...)

============================================
Opinions expressed above do not necessarily	-- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else.	  ...ames!atari!apratt