0

We have an old C++ application that reads and writes files on a file server using a hard coded UNC path. IT wants to migrate the file server to a distributed file system. I have just replaced the file server UNC path with the dfs namespace, but this does not work - fopen fails. Is this a DFS setup topic or do I need to address this in my application?

const char* userPath = "\\\\zher.domain.com\\share\\myAppsData\\users.dat";
FILE* fp;
errno_t err = fopen_s(&fp, userPath , "rb");
Ankit Shubham
  • 2,989
  • 2
  • 36
  • 61
  • Can you access the file outside the application? The documentation for `fopen_s()` states: `UNC paths and paths that involve mapped network drives are accepted by fopen_s as long as the system that's executing the code has access to the share or mapped network drive at the time of execution`. – piwi Apr 12 '16 at 08:12
  • That's C, not C++. – underscore_d Apr 12 '16 at 08:48
  • The issue is solved - ended up as a typo in the path. Accessing the DFS works just like the file server. – Lukas Vonblon Apr 15 '16 at 07:31

0 Answers0