Menu

#70 ftp::List format difference

open
nobody
None
5
2010-01-02
2010-01-02
John Roll
No

ftp::List returns a different result when called with "" and ".". I modified ftpvfs.tcl:

proc vfs::ftp::cachedList {fd dir} {
variable cacheList
variable cacheListingsFor

if { ![string compare $dir .] } {
set dir {}
}

# Caches response to prevent going back to the ftp server
# for common use cases: foreach {f} [glob *] { file stat $f s }
if {[info exists cacheList($dir)]} {
return $cacheList($dir)
}
set listing [ftp::List $fd $dir]

set cacheList($dir) $listing
after $cacheListingsFor [list unset -nocomplain ::vfs::ftp::cacheList($dir)]
return $listing
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.