On Mon, 2010-08-30, Francesco S. Carta wrote:
> Sherm Pendley <>, on 30/08/2010 13:21:13, wrote:
>
>> "Francesco S. Carta"<> writes:
>>
>>> Paul<>, on 30/08/2010 17:06:53, wrote:
>>>
>>>> Hello everyone!
>>>> I am creating a utility program that loops through a directory and
>>>> removes files using the c++ remove() function.
>>>> Now the problem is SOME files contain spaces in their names
>>>> ie: Lance Armstrong-JTM-020837.jpg
>>>> So how can i escape the names so remove() will work correctly.
>>>
>>> The std::remove algorithm has nothing to do with your problem.
>>
>> Then why bring it up?
>>
>>> Post your code and point out exactly what the issue is. With the
>>> amount of information you have given it takes a lucky wild guesser or
>>> a genius
>>
>> ... or someone who's also familiar with C functions, and isn't afraid
>> to call them from C++. 
>
> Ouch... I just forgot there is a remove() function that deletes files in
> the C heritage... OK, never mind, thanks for the reminder
It was complete news for me too, even though it has been in C since
C89 at least!
I think many of us go "oh, that area isn't well covered by the
standard library" and immediately reach for the OS-specific functions.
In this case, I'd have used Unix's unlink(2).
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .