FTP reply code 257 is returned in response to MKD (make directory) or PWD (print working directory) commands. For MKD, it confirms the directory was created and includes the new directory path in quotes. For PWD, it returns the current working directory path in quotes. The path is always enclosed in double quotes in the response (e.g., 257 "/home/user/newdir" created). If the path itself contains a double quote, it is escaped by doubling it. This response is how FTP clients determine their current location on the server.
The client sent PWD and the server returned the absolute path of the current working directory. FTP clients use this to display the current location and resolve relative paths.
The client sent MKD dirname and the server created the directory. The 257 response includes the full path of the newly created directory.
The directory path in the 257 response is enclosed in double quotes. When parsing programmatically, extract the text between the first and last double quotes, replacing any doubled quotes ("") with single quotes (").
After MKD creates a directory, use CWD to navigate into it. The path returned in the 257 response is the absolute path you can use with CWD.