4

I am trying to this:

wchar_t buff[PATH_MAX];
wgetcwd( buff, PATH_MAX);

I have also tried _wgetcwd. Google suggests _wgetcwd is in dir.h, but i have never heard of such a header file.

I'm using GCC 4.3.

Thank you.

mikbal
  • 1,168
  • 1
  • 16
  • 27
  • 1
    I would check `direct.h` or `wchar.h`. – ildjarn Dec 19 '12 at 22:14
  • 1
    What OS? (If the answer to this question is not Windows, then the answer to your question is "there is no such function, forget you ever heard of wchar_t and embrace UTF-8".) – zwol Dec 19 '12 at 22:15
  • it's linux. I am not a linux developer. I was looking for wchar_t like it is windows. – mikbal Dec 19 '12 at 22:17

1 Answers1

6

If this is a Unix/Linux system there is no point in looking for a wchar_t version of getcwd. That is because all file names and directory names are just bytes with the exception of the '/' and '\0' characters. You can use UTF-8 encoding with them but the filesystem itself does not care.

Zan Lynx
  • 53,022
  • 10
  • 79
  • 131