File: symlink.c

package info (click to toggle)
openslide 3.4.1%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,808 kB
  • sloc: ansic: 13,612; sh: 11,267; python: 586; makefile: 158; javascript: 80; xml: 35
file content (40 lines) | stat: -rw-r--r-- 1,155 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 *  OpenSlide, a library for reading whole slide image files
 *
 *  Copyright (c) 2014 Carnegie Mellon University
 *  All rights reserved.
 *
 *  OpenSlide is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as
 *  published by the Free Software Foundation, version 2.1.
 *
 *  OpenSlide is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with OpenSlide. If not, see
 *  <http://www.gnu.org/licenses/>.
 *
 */

#define _WIN32_WINNT 0x0600

#include <stdio.h>
#include <windows.h>

int main(int argc, char **argv) {
  if (argc != 3) {
    fprintf(stderr, "Usage: %s <src> <dst>\n", argv[0]);
    return 1;
  }

  const char *src = argv[1];
  const char *dst = argv[2];
  if (!CreateSymbolicLink(dst, src, 0)) {
    fprintf(stderr, "Failed with error %lu\n", GetLastError());
    return 1;
  }
  return 0;
}