ftpd::Session method CWD (protected)

 <instance of ftpd::Session[i]> CWD directory

Defined in

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
[ hide source ] | [ make this the default ]
Show another procedure: