Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2017-07-23
14:41 • Ticket [1613456fff] file readable lies with samba shared folder or file stat... artifact: f19a115afd user: kjnash
2013-09-24
22:00 • Closed ticket [1661378fff]: "file readable" broken on vmware shared fo... artifact: acd95ac7b2 user: dkf
2012-02-03
00:41 • Pending ticket [1661378fff]. artifact: 030b5258ff user: dgp
2012-01-14
01:26 • Ticket [1661378fff]: 4 changes artifact: 6f5604231d user: dgp
2008-08-15
23:59 • Ticket [1661378fff]: 4 changes artifact: fade478f28 user: dgp
2008-04-22
04:12 • Ticket [1661378fff]: 4 changes artifact: 9eb2967226 user: sbron
2008-04-15
23:25 • Ticket [1661378fff]: 4 changes artifact: f1b26de3a9 user: dgp
2008-01-24
05:19 • Ticket [1661378fff]: 2 changes artifact: 7e7611805b user: dgp
2008-01-23
06:05 • Ticket [1661378fff]: 5 changes artifact: 483d00cac4 user: vincentdarley
2007-11-08
20:29 • Ticket [1661378fff]: 4 changes artifact: 37d8bb9393 user: sbron
2007-02-20
02:56 • Ticket [1661378fff]: 4 changes artifact: d2802866b7 user: fvogelnew1
2007-02-16
18:16 • Ticket [1661378fff]: 2 changes artifact: fa264eb490 user: dkf
10:13 • New ticket [1661378fff]. artifact: 686fe07352 user: aotto1968

"file readable" broken on vmware shared folders

Closed / Fixed1661378fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 13 years ago
Descriptionplain2007-02-16 10:13:10
Dear Support,

  I have a problem with "file readable" on winxp 32bit
  as vmware guest on an openSuse host.

  I using "Shared Folders" on windows to access
  a directory from linux.

  but tcl on winxp has a problem with acessing
  files on the shared folder:

  detail:

   1. file readable returns 0 -> not readable
   2. but in tcl I can open and read this file -> readable
   3. the problem is that the tcl pkgLoader stops working

from tclPkgUnknown in tcl8.4 package.tcl
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
501   catch {
502       foreach file [glob -directory $dir -join -nocomplain \
503               * pkgIndex.tcl] {
504           set dir [file dirname $file]
505           if {![info exists procdDirs($dir)] && [file readable $file]} {
506               if {[catch {source $file} msg]} {
507                   tclLog "error reading package index file $file: $msg"
508               } else {
509                   set procdDirs($dir) 1
510               }
511           }
512       }
513   }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

the "file readable" will return 0 and the pkgLoader will not
load the pkgIndex.tcl file

=> this is a bug
from the code down you get the info that from inside tcl
"files readable" returns 0 but I can open and read the file

test script
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><

parray tcl_platform

foreach f {"//.host/Shared
Folders/FbgBase/src/TestFreiburg/lib/TestFbg/pkgIndex.tcl"} {

    puts "++ $f"
    if {![file exists $f]} {
        puts "  -> file does not exists !!"
        continue
    }
    unset -nocomplain stat
    unset -nocomplain attribute
    file stat $f stat
    array set attribute [file attributes $f]
    puts exists:[file exists $f]
    puts readable:[file readable $f]
    parray stat
    parray attribute
    set FH [open $f r]
    while {![eof $FH]} {
        puts "pkgIndex.tcl: [gets $FH]"
    }
    close $FH
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

results
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
tcl_platform(byteOrder) = littleEndian
tcl_platform(machine)   = intel
tcl_platform(os)        = Windows NT
tcl_platform(osVersion) = 5.1
tcl_platform(platform)  = windows
tcl_platform(user)      = SYSTEM
tcl_platform(wordSize)  = 4
++ //.host/Shared Folders/FbgBase/src/TestFreiburg/lib/TestFbg/pkgIndex.tcl
exists:1
readable:0
stat(atime) = 1171619183
stat(ctime) = 1171619183
stat(dev)   = -1
stat(gid)   = 0
stat(ino)   = 0
stat(mode)  = 33188
stat(mtime) = 1171545538
stat(nlink) = 1
stat(size)  = 369
stat(type)  = file
stat(uid)   = 0
attribute(-archive)   = 0
attribute(-hidden)    = 0
attribute(-longname)  = //.host/Shared
Folders/FbgBase/src/TestFreiburg/lib/TestFbg/pkgIndex.tcl
attribute(-readonly)  = 0
attribute(-shortname) = //.host/Shared
Folders/FbgBase/src/TestFreiburg/lib/TestFbg/pkgIndex.tcl
attribute(-system)    = 0
pkgIndex.tcl: ##
pkgIndex.tcl: ##  testFreiburg - src/TestFreiburg/lib/pkgIndex.tcl
pkgIndex.tcl: ##
pkgIndex.tcl: ##  (C) 2004 - Freiburg - Project - Group
pkgIndex.tcl: ##  ------------------------------------------------------
pkgIndex.tcl: ##  EMail: freiburg AT compiler-factory DOT de
pkgIndex.tcl: ##  ------------------------------------------------------
pkgIndex.tcl: ##  all rights reserved
pkgIndex.tcl: ##
pkgIndex.tcl:
pkgIndex.tcl: package ifneeded TestFbg 2.0 [list source [file join $dir
TestFbg.tcl]]
pkgIndex.tcl:
pkgIndex.tcl:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


mfg

  Andreas Otto
dkf Ticket [1661378fff]: 2 changes [History diff]2007-02-16 18:16:39
fvogelnew1plain2007-02-20 02:56:13
Logged In: YES 
user_id=1245417
Originator: NO

Similar issue seems to be #1613456 (with a Samba share).

Francois
sbronplain2007-11-08 20:29:43
Logged In: YES 
user_id=37987
Originator: NO

I see the same problems and found that it works correctly upto Tcl 8.4.12 and is broken from 8.4.13 onward.

Since this command is used inside [package unknown] this bug breaks loading of packages from vmware shared folders.
vincentdarleyplain2008-01-23 06:05:44
Logged In: YES 
user_id=32170
Originator: NO

Apologies, but I know nothing about vmware.
dgp Ticket [1661378fff]: 2 changes [History diff]2008-01-24 05:19:47
dgpplain2008-04-15 23:25:14
Logged In: YES 
user_id=80530
Originator: NO


Is this bug present in Tcl 8.5.2 ?
sbronplain2008-04-22 04:12:17
Logged In: YES 
user_id=37987
Originator: NO

The bug is still present in Tcl 8.5.2 (tested using tclkit852.exe):

(tclkit) 1 % cd Z:/hv/library
(library) 2 % lappend auto_path [pwd]
Z:/tclkit/tclkit852.exe/lib/tcl8.5 Z:/tclkit/tclkit852.exe/lib Z:/tclkit/tclkit852.exe/lib/tk8.5 Z:/tclkit/tclkit852.exe/lib/tk8.5/ttk Z:/hv/library
(library) 3 % package require pdf4tcl
can't find package pdf4tcl
(library) 4 % cd pdf4tcl
(pdf4tcl) 5 % file readable pkgIndex.tcl
0
(pdf4tcl) 6 % set f [open pkgIndex.tcl]
filef7e500
(pdf4tcl) 7 % string length [read $f]
706
(pdf4tcl) 8 % close $f
(pdf4tcl) 9 % info pa
8.5.2
dgpplain2008-08-15 23:59:57
Logged In: YES 
user_id=80530
Originator: NO


Possibly relevant article.

http://www.waltervos.com/news/shared-personal-folders-vista-ubuntu-permissions/
dgpplain2012-01-14 01:26:16
The branch 'fix-win-native-access' includes a patch that
may fix the bug reported here.

  http://core.tcl.tk/tcl/info/0aabf0529e

I'm not equipped to test the effectiveness of the
patch, or whether it introduces any new test
failures or other problems.  I'd be grateful if folks
who can and who are intersted in this bug and related
bugs could do so, and report back whether the patch
is suitable for merging into the release branches.
dgpplain2012-02-03 00:41:01
Patch from fix-win-native-access branch
committed for 8.4.20, 8.5.12, and 8.6b3.

Continued testing strongly encouraged.

In particular, the #define UNICODE variant
of the trunk is likely to have some lingering
problems.
dkf Closed ticket [1661378fff]. [History diff]2013-09-24 22:00:43
Log in (anonymous is fine) to add a comment.