[comp.sys.atari.st.tech] Hidden folders

ss60wbi@sdcc4.ucsd.edu (G. "Maddog" Knauss) (01/22/91)

You can make ANY file think it's a folder by fiddling with
GEMDOS(67).  This call will let you read or write all the file
attributes for anything on the disk, HIDDEN, SYSTEM, PROTECTED, all
that.  I shudder to think of what's going to happen to the disk
structure if the file isn't actually a folder, though.  A friend of
mind was goofing around with folder structures and managed to put a
folder inside itself, transforming it into Rusty the Undeletable
Folder..
	And to whoever was trying to find out what hidden files are
on his harddrive, START just published my "Hide-O-Rama."  It lets
you view and change the attributes for HIDDEN and SYSTEM files.
Little Green File Selector also displays HIDDEN files, and I think
UIS does as well.
				That way to a man's heart is through
				his ribcage,
				Greg "Maddog" Knauss

apratt@atari.UUCP (Allan Pratt) (01/24/91)

Somebody says "MAC copies to MSDOS (Atari) disks create a hidden folder."

Then ss60wbi@sdcc4.ucsd.edu (G. "Maddog" Knauss) writes:
>You can make ANY file think it's a folder by fiddling with
>GEMDOS(67). [...] I shudder to think of what's going to happen to the disk
>structure if the file isn't actually a folder, though.

TOS versions 1.4 and greater do not allow this.  They return "access
denied" if you try to change the folder bit to make a file into a folder.
You also can't set the volume-label bit or any of the undefined bits.

You can't change ANY of the attribute bits of a folder.  If the folder
bit is set, it has to be the ONLY bit set.  "Hidden folder" is an invalid
combination under GEMDOS.

Obviously, it's possible for something illegal to come in from outside.  I
really didn't think about this when I put those restrictions on Fattrib.
I'll have to think about that one.

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

wolfram@cip-s02.informatik.rwth-aachen.de (Wolfram Roesler) (02/01/91)

apratt@atari.UUCP (Allan Pratt) writes:

>TOS versions 1.4 and greater do not allow this.  They return "access
>denied" if you try to change the folder bit to make a file into a folder.
>You also can't set the volume-label bit or any of the undefined bits.

Now that we are talking about the undefined flags, what exactly do they do?
I remember setting them on a ramdisk file with the result of making that file
disappear, so I didnt do much more experiments about that.
Is it possible for applications to use these flags in a 'self defined' way?

BTW: why is it not possible to hide a folder? Just to keep people from turning
files to folders by changing a flag? How about making a folder readonly, which
would affect all of its files?

ss60wbi@sdcc4.ucsd.edu (G. "Maddog" Knauss) (02/02/91)

In article <wolfram.665404940@cip-s02> wolfram@cip-s02.informatik.rwth-aachen.de (Wolfram Roesler) writes:
>
>BTW: why is it not possible to hide a folder? Just to keep people from turning
>files to folders by changing a flag? How about making a folder readonly, which
>would affect all of its files?

I asked Allan Pratt about why we couldn't hide folders, and his
response was, "Because I didn't do it that way."  Which is good
enough for me.
					It's not really a big deal,
					either way,
					Greg "Maddog" Knauss

neil@cs.hw.ac.uk (Neil Forsyth) (02/05/91)

In article <wolfram.665404940@cip-s02>
wolfram@cip-s02.informatik.rwth-aachen.de (Wolfram Roesler) writes:
>BTW: why is it not possible to hide a folder? Just to keep people from turning
>files to folders by changing a flag? How about making a folder readonly, which
>would affect all of its files?

That would be fantastic! I would love to hide folders and protect their
contents this way. As it is I can hide a folder by flipping the bit manually
using a disk editor. (It's OK Allan I reboot afterwards!)

+----------------------------------------------------------------------------+
! DISCLAIMER:Unless otherwise stated, the above comments are entirely my own !
!                                                                            !
! 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, UK           "That was never 5 minutes!"              !
+----------------------------------------------------------------------------+

apratt@atari.UUCP (Allan Pratt) (02/07/91)

neil@cs.hw.ac.uk (Neil Forsyth) writes:
>As it is I can hide a folder by flipping the bit manually
>using a disk editor. (It's OK Allan I reboot afterwards!)

It's not OK.  GEMDOS's behavior in the presence of unexpected flag
combinations is undefined.  For example, some places in the code could
check for (attr & SUBDIR) but some check for (attr == SUBDIR). So you might
find that you can use the thing as a folder, but  you can also Fdelete it,
or if you Fcreate a file with the same name it'll get clobbered!  This
would be disaster for the files contained in the folder.

You're playing with fire.

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

hvaalde@cs.vu.nl (Aalderen van Harold) (02/07/91)

neil@cs.hw.ac.uk (Neil Forsyth) writes:

>I would love to hide folders and protect their contents this way.

If it ever gets implemented in TOS, remember that sometimes one would like to
be able to delete a hidden folder, so atleast offer the possibility to unhide
hidden items on the desktop. Perhaps an option like 'show hidden' and make them
ligther on screen or something like that.
It also makes it easier to keep track on what is on the disk if the number of
bytes that is hidden on a disk is mentionen in the 'disk info' dialog as it
is in Neodesk.

Harold van Aalderen (hvaalde@cs.vu.nl)

wolfram@ikki.informatik.rwth-aachen.de (Wolfram Roesler) (02/08/91)

apratt@atari.UUCP (Allan Pratt) writes:

>For example, some places in the code could
>check for [...] (attr == SUBDIR). 

If it is allowed to criticize the Sensei:
This a a VERY bad programming style.

apratt@atari.UUCP (Allan Pratt) (02/12/91)

>apratt@atari.UUCP (Allan Pratt) writes:
>>For example, some places in the code could
>>check for [...] (attr == SUBDIR). 

wolfram@ikki.informatik.rwth-aachen.de (Wolfram Roesler) writes:
>If it is allowed to criticize the Sensei:
>This a a VERY bad programming style.

Tell me about it.  I didn't write GEMDOS, I inherited it.  Besides, I
didn't say this was the case, I said it might be.  I think it is. I haven't
looked.  I choose not to look, so as to keep the possibility open.  It's
like Schroedinger's Cat: if you don't look, you don't know.  In this case,
I want to assume (and I want you all to assume) it's unsafe.

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