Two Surprising and Scary FS Behaviors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Two Surprising and Scary FS Behaviors

Sean P. DeNigris
Administrator
I may be ignorant of some key principle in the filesystem world, but IMHO
conceptually, `location / somethingElse` should always return either
location or something inside of it, unless the request explicitly requests
otherwise (e.g. location / '..'). To do otherwise could be disastrous.

Behavior #1
rootDataFolder := FileLocator home / 'a' / 'b' / .
subfolderName := self accidentallyReturnAnEmptyString.
assumedToBeInRootData := rootDataFolder / subfolderName.
assumedToBeInRootData deleteAll.

"I hope I have a recent machine backup, because..."
assumedToBeInRootData resolve = FileLocator root resolve. "WTH?!"

Behavior 2 (similar)
Path * 'a' / 'b' / '/' = Path root. "WTH?!"



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Two Surprising and Scary FS Behaviors

ducasse
I like your analysis because indeed it can bring bad news.
Can you turn this behaviour into memory file system tests?
So that we make sure that we should find a solution.

Stf

> On 6 Aug 2019, at 00:41, Sean P. DeNigris <[hidden email]> wrote:
>
> I may be ignorant of some key principle in the filesystem world, but IMHO
> conceptually, `location / somethingElse` should always return either
> location or something inside of it, unless the request explicitly requests
> otherwise (e.g. location / '..'). To do otherwise could be disastrous.
>
> Behavior #1
> rootDataFolder := FileLocator home / 'a' / 'b' / .
> subfolderName := self accidentallyReturnAnEmptyString.
> assumedToBeInRootData := rootDataFolder / subfolderName.
> assumedToBeInRootData deleteAll.
>
> "I hope I have a recent machine backup, because..."
> assumedToBeInRootData resolve = FileLocator root resolve. "WTH?!"
>
> Behavior 2 (similar)
> Path * 'a' / 'b' / '/' = Path root. "WTH?!"
>
>
>
> -----
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
>