Annotation of solidite/utils/link.cpp, revision 1.1.1.1

1.1       user        1: /* Copyright (c) 2026 The Solidite Developers
                      2:  *
                      3:  * This program is free software: you can redistribute it and/or modify it under
                      4:  * the terms of the GNU Affero General Public License as published by the Free
                      5:  * Software Foundation, either version 3 of the License, or (at your option)
                      6:  * any later version.
                      7:  *
                      8:  * This program is distributed in the hope that it will be useful, but WITHOUT
                      9:  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
                     10:  * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
                     11:  * details.
                     12:  *
                     13:  * You should have received a copy of the GNU Affero General Public License
                     14:  * along with this program. If not, see <https://www.gnu.org/licenses/>. */
                     15: 
                     16: #include <filesystem>
                     17: #include <iostream>
                     18: #include <locale>
                     19: 
                     20: int main(int argc, char* argv[]) {
                     21:   // locale work
                     22:   std::locale::global(std::locale(""));
                     23:   std::cerr.imbue(std::locale()); 
                     24: 
                     25:   if (argc < 3) {
                     26:     std::cerr << "not enough arguments\n";
                     27:     return 1;
                     28:   }
                     29: 
                     30:   try {
                     31:     std::filesystem::create_hard_link(argv[1], argv[2]);
                     32:   } catch (...) {
                     33:     std::cerr << "failed to create hard link\n";
                     34:     return 1;
                     35:   }
                     36:   return 0;
                     37: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>