Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

file readable issue on SMB network

17 views
Skip to first unread message

jose-v

unread,
Jun 22, 2009, 5:45:17 AM6/22/09
to
Dear all,

I'm having problems in testing the readability of files in a SMB
mounted unit (Mac server, Windows client) by using "file readable".

"file readable Y:" returns 0, while I can perfectly read that unit and
all of its contents ("open Y:/test.txt r" works perfectly). In
contrast, "file readable C:" returns 1, as it should.

This problem has been reported some time ago (2006) in this group with
the subject "file readable issue on samba network", for Tcl 8.4. I can
still reproduce it now in my compiled 8.5.4 and the downloaded 8.5.7
in ActiveState. I was thinking on reporting this as a bug, but I
wanted to ask you first in case I'm missing anything important.

Cheers,

j.

Ralf Fassel

unread,
Jun 22, 2009, 6:27:57 AM6/22/09
to
* jose-v <jos...@users.sourceforge.net>

| I'm having problems in testing the readability of files in a SMB
| mounted unit (Mac server, Windows client) by using "file readable".

Why don't you just open the file and catch any error? Since the file
status may change between your 'file readable' call and the call to
open, you need to handle those errors anyway...

R'

ZB

unread,
Jun 22, 2009, 11:38:44 AM6/22/09
to
Dnia 22.06.2009 Ralf Fassel <ral...@gmx.de> napisaďż˝/a:

> Why don't you just open the file and catch any error? Since the file
> status may change between your 'file readable' call and the call to
> open, you need to handle those errors anyway...

...but despite the above [file readable $xyz] should return proper status
at the time of check-out, shouldn't it?
--
ZB

ho-tse

unread,
Jun 23, 2009, 5:26:58 AM6/23/09
to
Thanks for the reply!

> Why don't you just open the file and catch any error?

The file is not going to be read by Tcl but sent for reading somewhere
else, so I can not just [catch] it. Of course error handling when
opening is necessary, but [file readable] should do its job reporting
the correct thing, for my interface to decide what to show to the
user.

Your suggestion is a good workaround, I can implement my own proc
isFileReadable and try to [open $file "r"] just to see if that is
possible, return 0 otherwise. But [file readable] is there supposedly
to save me that job!

I will probably use your suggestion while I report this as a bug...

ho-tse

unread,
Jun 23, 2009, 5:33:12 AM6/23/09
to
Still, now that I think about it, this alternative method works only
for files, not for directories, as you can not open them...
Programming my own versatile isPathReadable is trickier!

ho-tse

unread,
Jun 23, 2009, 5:38:00 AM6/23/09
to

Ralf Fassel

unread,
Jun 23, 2009, 8:06:00 AM6/23/09
to
* ZB <zbWITHOUT_THIS@AND_THATjabster.pl>

| ...but despite the above [file readable $xyz] should return proper
| status at the time of check-out, shouldn't it?

Of course it should (in the application of the OP it actually needs to).

I also encountered similar (?) problems with 'file executable' on Samba
shares some time ago:

http://sourceforge.net/tracker/index.php?func=detail&aid=1951574&group_id=10894&atid=110894

R'

Don Porter

unread,
Jun 23, 2009, 10:11:44 AM6/23/09
to
jose-v wrote:
> This problem has been reported some time ago (2006) in this group with
> the subject "file readable issue on samba network", for Tcl 8.4. I can
> still reproduce it now in my compiled 8.5.4 and the downloaded 8.5.7
> in ActiveState. I was thinking on reporting this as a bug, but I
> wanted to ask you first in case I'm missing anything important.

Can you please try the same testing with Tcl release 8.4.12 and confirm
that this unwelcome behavior was introduced in the 8.4.13 release?

--
| Don Porter Mathematical and Computational Sciences Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

ho-tse

unread,
Jun 24, 2009, 3:25:26 AM6/24/09
to

> Can you please try the same testing with Tcl release 8.4.12 and confirm
> that this unwelcome behavior was introduced in the 8.4.13 release?

I can not test 8.4.13 right now, but indeed [file readable Y:] worked
correctly in 8.4.12 but returns a wrong answer in 8.4.14.

j.

Koen Danckaert

unread,
Jun 24, 2009, 5:09:18 AM6/24/09
to

Are you sure it worked "correctly" ?
My impression is:
- In 8.4.12, [file readable] always returned 1 on an SMB drive.
- In 8.5.4, it returns the whether the file is world readable.

So both are incorrect, but the new behaviour causes more problems.

Koen

ho-tse

unread,
Jun 25, 2009, 8:43:35 AM6/25/09
to
> Are you sure it worked "correctly" ?

Well, you're right, I haven't properly tested it.

All I noticed is that in 8.4.12 [file readable Y:] returned 1 when
that was what I was expecting, but 0 in a later version. And because
Don's email suggested that a bug could have been introduced in there,
I was eager to confirm it :-)

Don Porter

unread,
Jun 25, 2009, 9:26:50 AM6/25/09
to

>>> Can you please try the same testing with Tcl release 8.4.12 and confirm
>>> that this unwelcome behavior was introduced in the 8.4.13 release?

ho-tse wrote:
>> I can not test 8.4.13 right now, but indeed [file readable Y:] worked
>> correctly in 8.4.12 but returns a wrong answer in 8.4.14.

Koen Danckaert wrote:
> Are you sure it worked "correctly" ?
> My impression is:
> - In 8.4.12, [file readable] always returned 1 on an SMB drive.
> - In 8.5.4, it returns the whether the file is world readable.
>
> So both are incorrect, but the new behaviour causes more problems.

Ok, those impressions tend to confirm my impression that the unwelcome
behavior arrived in the patch that was committed to fix Tcl Bug 1193497.

The challenge for the party with the right interests, skills, and tools
is to look at that patch, and see how [file readable] was implemented
before and after it, and craft some new implementation that corrects
the unwelcome behavior now being observed without restoring the
Tcl Bug 1193497 at the same time.

Until such a person follows through on that, I expect the problem
to remain.

0 new messages