[squeak-dev] FileDirectory fails
K K Subbu
kksubbu.ml at gmail.com
Sat Jun 13 14:49:08 UTC 2020
On 13/06/20 7:47 pm, Tobias Pape wrote:
>
>> On 13.06.2020, at 16:02, K K Subbu <kksubbu.ml at gmail.com> wrote:
>>
>> Hi,
>>
>> On the latest alpha, I see
>> {
>> FileDirectory on: '.'.
>> FileDirectory on: './test'.
>> FileDirectory on: ''}
>>
>> {UnixFileDirectory on '/.' . UnixFileDirectory on '/./test' . UnixFileDirectory on '/'}
>>
>> Anyone else see the same problems? What about on Macs?
>>
>> The file tests are all green :-(.
>
> This is actually the currently expected behavior.
> What was your expectation?
Each one is a valid path.
'.' is lazily bound name for current directory. './test' is
#(dirname->'.' basename->'test') and '' (empty string) evaluates to '.'
in a directory context and an error in a file context since empty
filenames are not allowed. nil is not a valid path but commands do have
their own defaults ($HOME for chdir, '.' for ls, ..). E.g.
$ cd . # remain in current directory
$ cd '' # empty path. remain in current directory
$ cd # no directory specified. use $HOME
$ ls ./test # list test in current directory
$ ls test # valid file but no dir. use current directory
$ ls . # valid dir but no file. list directory
$ ls '' # empty path. cannot access '': No such file or directory
$ ls # no path specified. show all files in '.'
$ ls -d # no path specified. show dir info for '.'
Regards .. Subbu
More information about the Squeak-dev
mailing list
|