File: hssystemfileio-win32.c

package info (click to toggle)
haskell-system-fileio 0.3.11-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 156 kB
  • ctags: 15
  • sloc: haskell: 1,285; ansic: 147; sh: 51; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 310 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "hssystemfileio-win32.h"

#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>

int
hssystemfileio_copy_permissions(const wchar_t *old_path, const wchar_t *new_path)
{
	struct _stat st;
	int rc = _wstat(old_path, &st);
	if (rc == -1)
	{ return rc; }
	
	return _wchmod(new_path, st.st_mode);
}