ftpd::Session method CWD (protected)
<instance of ftpd::Session> CWD directory
Check if path is absolute or relative
- Parameters:
- directory (required)
- Testcases:
- No testcase defined.
Source code: if {[string match "/*" $directory]} { set newdir ${:rootdir}$directory } else { set newdir ${:currentdir}/$directory } # # Normalize the path and check validity # set newdir [file normalize $newdir] :log debug "currentdir <${:currentdir}> rootdir <${:rootdir}> newdir <$newdir>" if {[string length $newdir] < [string length ${:rootdir}] || ![file readable $newdir] || ![file isdirectory $newdir] } { :reply "550 cannot change to directory $directory" } else { set :currentdir $newdir :reply "250 Okay." }XQL Not present: Generic, PostgreSQL, Oracle