Jump to content
  • Advertisement
Sign in to follow this  
DarkRadeon

[VC++] Delete file with Unicode file-name?

This topic is 2534 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I must delete a file with an Unicode name. The file-name is stored in a wstring. Is there a way to do it without using windows api?

std::remove( ) of cstdio library doesn't work with wchar_t...

Share this post


Link to post
Share on other sites
Advertisement
I do not believe so. There are of course a libraries that wrap Windows file handling functions, to present a platform neutral interface. Other than that, I fear you may be out of luck.

Share this post


Link to post
Share on other sites

There is int _wremove(const wchar_t* path) function in <stdio.h>

I think _wremove() is a Windows-specific function (not sure whether one would class it as part of the Windows API, or whether that matters to the OP)

Share this post


Link to post
Share on other sites
mmm OK, but this should avoid the need of VC++ redistributable for the end user.. I hope that with VC++12 MS will finally bring standard Unicode support (VC++11 will not support it .-. )

Share this post


Link to post
Share on other sites
_wremove is in the CRT, implying that you'll need to ship a CRT redistrubable installer anyway unless you statically link againt the CRT.

DeleteFile(W|A) is actually in kernel32.dll, which requires no redistributable installer.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!