vfs::ftp will keep listing caches even after the mount has been unmounted. This leads to wrong results if different ftp directories are mounted at the same local directory in quick succession (think automated download script)
Example:
package require vfs::ftp
set ::vfs::ftp::cache_listings 0
set fd [vfs::ftp::Mount user1:pass@host/~user1 ftp]
glob ftp/*
vfs::ftp::Unmount $fd ftp
set fd [vfs::ftp::Mount user2:pass@host/~user2/ ftp]
# this glob will display the cached results for user1
glob ftp/*
vfs::ftp::Unmount $fd ftp
Fix seems to be to clear the cache list at Unmount:
proc vfs::ftp::Unmount {fd local} {
vfs::filesystem unmount $local
unset -nocomplain ::vfs::ftp::cacheList
::ftp::Close $fd
}
Logged In: YES
user_id=1463011
Originator: NO
Issue was logged by me
Logged In: YES
user_id=1463011
Originator: NO
Removing the complete cache (although it fixes the problem) is a bit over-aggressive. Really on the cached listings for the unmounted dir should be removed.
Logged In: YES
user_id=1463011
Originator: NO
Removing the complete cache (although it fixes the problem) is a bit over-aggressive. Really on the cached listings for the unmounted dir should be removed.
This doesn't seem to be correct code for the latest ftpvfs.tcl. As a user, can you say how the actual cacheList items are ordered? Is sounds like an [array unset ...] with the right pattern ($local == $dir?) is needed.