Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read symbolic links on windows instead of synchting a null file #2164

Open
fakuivan opened this issue Jan 28, 2019 · 0 comments
Open

Read symbolic links on windows instead of synchting a null file #2164

fakuivan opened this issue Jan 28, 2019 · 0 comments

Comments

@fakuivan
Copy link

How could code from:

seafile/lib/utils.c

Lines 532 to 561 in 9299751

#ifdef WIN32
wchar_t *wpath;
DWORD access = 0;
HANDLE handle;
int fd;
access |= GENERIC_READ;
if (flags & (O_WRONLY | O_RDWR))
access |= GENERIC_WRITE;
wpath = win32_long_path (path);
handle = CreateFileW (wpath,
access,
FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
if (handle == INVALID_HANDLE_VALUE) {
errno = windows_error_to_errno (GetLastError());
g_free (wpath);
return -1;
}
fd = _open_osfhandle ((intptr_t)handle, 0);
g_free (wpath);
return fd;
#else

be changed so that it reads symbolic links correctly on windows? Currently they are read as an empty file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants