cURL / Mailing Lists / curl-library / Single Mail

curl-library

FTP, mkdir and escaping invalid characters

From: Nick Jensen <nickrjensen_at_gmail.com>
Date: Mon, 25 Jan 2010 11:57:37 -0500

Hello,

I am using libcurl to create directories on a FTP server by using
CURLOPT_QUOTE and sending a list of MKD commands. Everything works fine, but
my quote commands fail if the directory name has an invalid character in it
such as a space or a symbol. Does curl have an escape function for this. I
noticed there is curl_easy_escape() which will URL encode a string but that
isn't what I need here.

For example I want to turn:

"MKD this dir. has invalid: characters" into "MKD this\ dir\.\ has\
invalid\:\ characters"

I also assume that different FTP servers have a slightly different set of
valid file/directory name characters. Can anyone suggest a good
cross-platform solution for escaping my MKD commands?

Thanks

Nick

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-25