forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatehardlink.cpp
More file actions
39 lines (33 loc) · 859 Bytes
/
createhardlink.cpp
File metadata and controls
39 lines (33 loc) · 859 Bytes
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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//! @brief create new hard link
#include "createhardlink.h"
#include <assert.h>
#include <unistd.h>
#include <string>
//! @brief Createhardlink create new symbolic link
//!
//! Createhardlink
//!
//! @param[in] link
//! @parblock
//! A pointer to the buffer that contains the symbolic link to create
//!
//! char* is marshaled as an LPStr, which on Linux is UTF-8.
//! @endparblock
//!
//! @param[in] target
//! @parblock
//! A pointer to the buffer that contains the existing file
//!
//! char* is marshaled as an LPStr, which on Linux is UTF-8.
//! @endparblock
//!
//! @retval 0 if successful, otherwise -1
//!
int32_t CreateHardLink(const char *newlink, const char *target)
{
assert(newlink);
assert(target);
return link(target, newlink);
}