From 55227375e9d6b0d83fd25c1e1cabdb7536d82296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 5 Aug 2020 12:18:33 +0300 Subject: [PATCH] fsutil: Add support for creating hardlinks. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=22749 Signed-off-by: Vijay Kiran Kamuju Signed-off-by: Arkadiusz Hiler Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- configure | 1 + configure.ac | 1 + po/ar.po | 13 +++- po/ast.po | 13 +++- po/bg.po | 13 +++- po/ca.po | 13 +++- po/cs.po | 13 +++- po/da.po | 13 +++- po/de.po | 13 +++- po/el.po | 13 +++- po/en.po | 18 +++++- po/en_US.po | 18 +++++- po/eo.po | 13 +++- po/es.po | 13 +++- po/fa.po | 13 +++- po/fi.po | 13 +++- po/fr.po | 13 +++- po/he.po | 13 +++- po/hi.po | 13 +++- po/hr.po | 13 +++- po/hu.po | 13 +++- po/it.po | 13 +++- po/ja.po | 13 +++- po/ko.po | 13 +++- po/lt.po | 13 +++- po/ml.po | 13 +++- po/nb_NO.po | 13 +++- po/nl.po | 13 +++- po/or.po | 13 +++- po/pa.po | 13 +++- po/pl.po | 13 +++- po/pt_BR.po | 13 +++- po/pt_PT.po | 13 +++- po/rm.po | 13 +++- po/ro.po | 13 +++- po/ru.po | 13 +++- po/si.po | 13 +++- po/sk.po | 13 +++- po/sl.po | 13 +++- po/sr_RS@cyrillic.po | 13 +++- po/sr_RS@latin.po | 13 +++- po/sv.po | 13 +++- po/ta.po | 13 +++- po/te.po | 13 +++- po/th.po | 13 +++- po/tr.po | 13 +++- po/uk.po | 13 +++- po/wa.po | 13 +++- po/wine.pot | 13 +++- po/zh_CN.po | 13 +++- po/zh_TW.po | 13 +++- programs/fsutil/fsutil.mc | 14 ++++- programs/fsutil/main.c | 57 +++++++++++++++++- programs/fsutil/resources.h | 2 + programs/fsutil/tests/Makefile.in | 5 ++ programs/fsutil/tests/fsutil.c | 98 +++++++++++++++++++++++++++++++ 56 files changed, 771 insertions(+), 54 deletions(-) create mode 100644 programs/fsutil/tests/Makefile.in create mode 100644 programs/fsutil/tests/fsutil.c diff --git a/configure b/configure index 0493e2a653b..c93e000e8f9 100755 --- a/configure +++ b/configure @@ -21444,6 +21444,7 @@ wine_fn_config_makefile programs/find enable_find wine_fn_config_makefile programs/find/tests enable_tests wine_fn_config_makefile programs/findstr enable_findstr wine_fn_config_makefile programs/fsutil enable_fsutil +wine_fn_config_makefile programs/fsutil/tests enable_tests wine_fn_config_makefile programs/hh enable_hh wine_fn_config_makefile programs/hostname enable_hostname wine_fn_config_makefile programs/icacls enable_icacls diff --git a/configure.ac b/configure.ac index 0a556635a2d..4ff0f9c81f7 100644 --- a/configure.ac +++ b/configure.ac @@ -3979,6 +3979,7 @@ WINE_CONFIG_MAKEFILE(programs/find) WINE_CONFIG_MAKEFILE(programs/find/tests) WINE_CONFIG_MAKEFILE(programs/findstr) WINE_CONFIG_MAKEFILE(programs/fsutil) +WINE_CONFIG_MAKEFILE(programs/fsutil/tests) WINE_CONFIG_MAKEFILE(programs/hh) WINE_CONFIG_MAKEFILE(programs/hostname) WINE_CONFIG_MAKEFILE(programs/icacls) diff --git a/po/ar.po b/po/ar.po index beaa036ff14..d7d192bdc02 100644 --- a/po/ar.po +++ b/po/ar.po @@ -13157,7 +13157,18 @@ msgstr "ش&غل..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/ast.po b/po/ast.po index c05472979d5..3404fc4dbe7 100644 --- a/po/ast.po +++ b/po/ast.po @@ -12166,7 +12166,18 @@ msgstr "&Executar..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/bg.po b/po/bg.po index 6d84c14ffac..4149ad18e45 100644 --- a/po/bg.po +++ b/po/bg.po @@ -12462,7 +12462,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/ca.po b/po/ca.po index 2d5954f59f1..fe47771079a 100644 --- a/po/ca.po +++ b/po/ca.po @@ -12668,7 +12668,18 @@ msgstr "&Executa..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/cs.po b/po/cs.po index 8ed710483dd..1211225f884 100644 --- a/po/cs.po +++ b/po/cs.po @@ -12678,7 +12678,18 @@ msgstr "&Spustit..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/da.po b/po/da.po index 69ad6863c82..5ae7fd058ed 100644 --- a/po/da.po +++ b/po/da.po @@ -13070,7 +13070,18 @@ msgstr "Kø&r..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/de.po b/po/de.po index cbf6b6e03d7..345b1d31dae 100644 --- a/po/de.po +++ b/po/de.po @@ -12631,7 +12631,18 @@ msgstr "&Ausführen..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/el.po b/po/el.po index a6bdf27bf38..ded09d69446 100644 --- a/po/el.po +++ b/po/el.po @@ -12249,7 +12249,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/en.po b/po/en.po index 9cfb0480593..b80b04528e5 100644 --- a/po/en.po +++ b/po/en.po @@ -12505,11 +12505,25 @@ msgstr "&Run..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" msgstr "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" +msgstr "Syntax: fsutil hardlink create \n" #: hostname.rc:30 msgid "Usage: hostname\n" diff --git a/po/en_US.po b/po/en_US.po index 28a637d9591..4651f4dfb7a 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -12505,11 +12505,25 @@ msgstr "&Run..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" msgstr "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" +msgstr "Syntax: fsutil hardlink create \n" #: hostname.rc:30 msgid "Usage: hostname\n" diff --git a/po/eo.po b/po/eo.po index be669fa9d98..4d5789c773a 100644 --- a/po/eo.po +++ b/po/eo.po @@ -12320,7 +12320,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/es.po b/po/es.po index 0c9b65ce602..611aded8de7 100644 --- a/po/es.po +++ b/po/es.po @@ -13142,7 +13142,18 @@ msgstr "E&jecutar..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/fa.po b/po/fa.po index 78c6d580969..f6473a164a7 100644 --- a/po/fa.po +++ b/po/fa.po @@ -12203,7 +12203,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/fi.po b/po/fi.po index 0bbb9156c45..2628c1e4e57 100644 --- a/po/fi.po +++ b/po/fi.po @@ -12481,7 +12481,18 @@ msgstr "&Suorita..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/fr.po b/po/fr.po index 0469fc56c9a..ba34cb4d196 100644 --- a/po/fr.po +++ b/po/fr.po @@ -13043,7 +13043,18 @@ msgstr "E&xécuter..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/he.po b/po/he.po index c11b9c1bdd5..53d39b96144 100644 --- a/po/he.po +++ b/po/he.po @@ -12712,7 +12712,18 @@ msgstr "הפע&לה..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/hi.po b/po/hi.po index 8227e0efba4..171cd14c0b8 100644 --- a/po/hi.po +++ b/po/hi.po @@ -12000,7 +12000,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/hr.po b/po/hr.po index adaa2ab5deb..571607a4ec2 100644 --- a/po/hr.po +++ b/po/hr.po @@ -12624,7 +12624,18 @@ msgstr "Pok&reni..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/hu.po b/po/hu.po index 472ce8c0655..789d760f18a 100644 --- a/po/hu.po +++ b/po/hu.po @@ -13061,7 +13061,18 @@ msgstr "&Futtatás..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/it.po b/po/it.po index befa3e62d48..dcee8b6c406 100644 --- a/po/it.po +++ b/po/it.po @@ -13143,7 +13143,18 @@ msgstr "&Esegui..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/ja.po b/po/ja.po index 2ef2039682b..4d072d5fce4 100644 --- a/po/ja.po +++ b/po/ja.po @@ -12496,7 +12496,18 @@ msgstr "実行(&R)..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/ko.po b/po/ko.po index ec83dc63493..b27e25f2d25 100644 --- a/po/ko.po +++ b/po/ko.po @@ -12543,7 +12543,18 @@ msgstr "실행(&R)..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/lt.po b/po/lt.po index cc3bcf25b74..bf5b4e2ef6e 100644 --- a/po/lt.po +++ b/po/lt.po @@ -12509,7 +12509,18 @@ msgstr "&Vykdyti..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/ml.po b/po/ml.po index 2a0b4548264..c391e6d4476 100644 --- a/po/ml.po +++ b/po/ml.po @@ -12014,7 +12014,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/nb_NO.po b/po/nb_NO.po index 9c359c57450..f7fdd070fc9 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -12681,7 +12681,18 @@ msgstr "Kjø&r..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/nl.po b/po/nl.po index 33c33df3ea6..068ef624749 100644 --- a/po/nl.po +++ b/po/nl.po @@ -13106,7 +13106,18 @@ msgstr "&Starten..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/or.po b/po/or.po index 5b80b5e37b2..0d4820ae100 100644 --- a/po/or.po +++ b/po/or.po @@ -12000,7 +12000,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/pa.po b/po/pa.po index 16823db0101..4b228c7a5bd 100644 --- a/po/pa.po +++ b/po/pa.po @@ -12000,7 +12000,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/pl.po b/po/pl.po index b2cee3e8135..f8978ac8095 100644 --- a/po/pl.po +++ b/po/pl.po @@ -12849,7 +12849,18 @@ msgstr "Urucho&m..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/pt_BR.po b/po/pt_BR.po index d55f787de07..85204565a5e 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -12641,7 +12641,18 @@ msgstr "E&xecutar..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/pt_PT.po b/po/pt_PT.po index baca2bab051..20de413f6c3 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -12820,7 +12820,18 @@ msgstr "Exec&utar..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/rm.po b/po/rm.po index 5be43f3d106..99ee7780afe 100644 --- a/po/rm.po +++ b/po/rm.po @@ -12083,7 +12083,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/ro.po b/po/ro.po index accffc4472d..52ab6bbfb9c 100644 --- a/po/ro.po +++ b/po/ro.po @@ -12900,7 +12900,18 @@ msgstr "E&xecutare..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/ru.po b/po/ru.po index 384ba118094..af22b22e6ce 100644 --- a/po/ru.po +++ b/po/ru.po @@ -12560,7 +12560,18 @@ msgstr "&Запустить..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/si.po b/po/si.po index 59346b6884d..b3bdc6730d9 100644 --- a/po/si.po +++ b/po/si.po @@ -12261,7 +12261,18 @@ msgstr "ධාවනය කරන්න... (&R)" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/sk.po b/po/sk.po index 74853846013..1b1057d0c98 100644 --- a/po/sk.po +++ b/po/sk.po @@ -12460,7 +12460,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/sl.po b/po/sl.po index 9686033eed7..0dfd25b418c 100644 --- a/po/sl.po +++ b/po/sl.po @@ -13092,7 +13092,18 @@ msgstr "&Zaženi ..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/sr_RS@cyrillic.po b/po/sr_RS@cyrillic.po index b0e34c499c2..cb956091964 100644 --- a/po/sr_RS@cyrillic.po +++ b/po/sr_RS@cyrillic.po @@ -12734,7 +12734,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/sr_RS@latin.po b/po/sr_RS@latin.po index 21df6f72def..80e14a29dd1 100644 --- a/po/sr_RS@latin.po +++ b/po/sr_RS@latin.po @@ -12861,7 +12861,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/sv.po b/po/sv.po index a5bdd616fbe..baa9e29e7ca 100644 --- a/po/sv.po +++ b/po/sv.po @@ -12812,7 +12812,18 @@ msgstr "&Kör..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/ta.po b/po/ta.po index 28c5a25cbbd..a1ad8db3730 100644 --- a/po/ta.po +++ b/po/ta.po @@ -11934,7 +11934,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/te.po b/po/te.po index 4bb2583004d..d465d6b8252 100644 --- a/po/te.po +++ b/po/te.po @@ -12000,7 +12000,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/th.po b/po/th.po index a69f6aaaeab..a7a5d451498 100644 --- a/po/th.po +++ b/po/th.po @@ -12282,7 +12282,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/tr.po b/po/tr.po index 6f9cf899e85..301f37740ad 100644 --- a/po/tr.po +++ b/po/tr.po @@ -12592,7 +12592,18 @@ msgstr "&Çalıştır..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/uk.po b/po/uk.po index d6626b0b12e..bb7df19dc0f 100644 --- a/po/uk.po +++ b/po/uk.po @@ -12637,7 +12637,18 @@ msgstr "&Запустити..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/wa.po b/po/wa.po index 289f674b6f5..61de1bafc91 100644 --- a/po/wa.po +++ b/po/wa.po @@ -12186,7 +12186,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/wine.pot b/po/wine.pot index cae281066cd..a115121222e 100644 --- a/po/wine.pot +++ b/po/wine.pot @@ -11917,7 +11917,18 @@ msgstr "" msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/zh_CN.po b/po/zh_CN.po index 007eaea039b..00432ff7de4 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -12300,7 +12300,18 @@ msgstr "运行(&R)..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/po/zh_TW.po b/po/zh_TW.po index a2c7d9dd4b8..841093ce1b5 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -13067,7 +13067,18 @@ msgstr "執行(&R)..." msgid "" "- Supported Commands -\n" "\n" -"[NONE]\n" +"hardlink hardlink management\n" +msgstr "" + +#: fsutil.mc:35 +msgid "" +"- Hardlink - Supported Commands -\n" +"\n" +"create create a hardlink\n" +msgstr "" + +#: fsutil.mc:40 +msgid "Syntax: fsutil hardlink create \n" msgstr "" #: hostname.rc:30 diff --git a/programs/fsutil/fsutil.mc b/programs/fsutil/fsutil.mc index 54c801cb2bf..e904bb8644b 100644 --- a/programs/fsutil/fsutil.mc +++ b/programs/fsutil/fsutil.mc @@ -23,5 +23,17 @@ SymbolicName=STRING_USAGE Language=ENU - Supported Commands - -[NONE] +hardlink hardlink management +. +MessageId=102 +SymbolicName=STRING_HARDLINK_USAGE +Language=ENU +- Hardlink - Supported Commands - + +create create a hardlink +. +MessageId=103 +SymbolicName=STRING_HARDLINK_CREATE_USAGE +Language=ENU +Syntax: fsutil hardlink create . diff --git a/programs/fsutil/main.c b/programs/fsutil/main.c index 1d61edab752..bde07ac2df5 100644 --- a/programs/fsutil/main.c +++ b/programs/fsutil/main.c @@ -66,6 +66,54 @@ static int WINAPIV output_string(int msg, ...) return 0; } +static BOOL output_error_string(DWORD error) +{ + LPWSTR pBuffer; + if (FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, + NULL, error, 0, (LPWSTR)&pBuffer, 0, NULL)) + { + output_write(pBuffer, lstrlenW(pBuffer)); + LocalFree(pBuffer); + return TRUE; + } + return FALSE; +} + +static int create_hardlink(int argc, WCHAR *argv[]) +{ + if (argc != 5) + { + output_string(STRING_HARDLINK_CREATE_USAGE); + return 1; + } + + if (CreateHardLinkW(argv[3], argv[4], NULL)) + return 0; + + output_error_string(GetLastError()); + return 1; +} + +static int hardlink(int argc, WCHAR *argv[]) +{ + int ret; + + if (argc > 2) + { + if (!wcsicmp(argv[2], L"create")) + return create_hardlink(argc, argv); + else + { + FIXME("unsupported parameter %s\n", debugstr_w(argv[2])); + ret = 1; + } + } + + output_string(STRING_HARDLINK_USAGE); + return ret; +} + int __cdecl wmain(int argc, WCHAR *argv[]) { int i, ret = 0; @@ -77,8 +125,13 @@ int __cdecl wmain(int argc, WCHAR *argv[]) if (argc > 1) { - FIXME("unsupported command %s\n", debugstr_w(argv[1])); - ret = 1; + if (!wcsicmp(argv[1], L"hardlink")) + return hardlink(argc, argv); + else + { + FIXME("unsupported command %s\n", debugstr_w(argv[1])); + ret = 1; + } } output_string(STRING_USAGE); diff --git a/programs/fsutil/resources.h b/programs/fsutil/resources.h index 36b0ffc35f1..56280d958a6 100644 --- a/programs/fsutil/resources.h +++ b/programs/fsutil/resources.h @@ -19,3 +19,5 @@ #include #define STRING_USAGE 101 +#define STRING_HARDLINK_USAGE 102 +#define STRING_HARDLINK_CREATE_USAGE 103 diff --git a/programs/fsutil/tests/Makefile.in b/programs/fsutil/tests/Makefile.in new file mode 100644 index 00000000000..5a69e47dc61 --- /dev/null +++ b/programs/fsutil/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = fsutil.exe +IMPORTS = user32 + +C_SRCS = \ + fsutil.c diff --git a/programs/fsutil/tests/fsutil.c b/programs/fsutil/tests/fsutil.c new file mode 100644 index 00000000000..98677882741 --- /dev/null +++ b/programs/fsutil/tests/fsutil.c @@ -0,0 +1,98 @@ +/* + * Copyright 2020 Arkadiusz Hiler for CodeWeavers + * + * This library 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; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include "wine/test.h" + +static DWORD runcmd(const char* cmd) +{ + STARTUPINFOA si = { sizeof(STARTUPINFOA) }; + PROCESS_INFORMATION pi; + char* wcmd; + DWORD rc; + + /* Create a writable copy for CreateProcessA() */ + wcmd = HeapAlloc(GetProcessHeap(), 0, strlen(cmd) + 1); + strcpy(wcmd, cmd); + + rc = CreateProcessA(NULL, wcmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + HeapFree(GetProcessHeap(), 0, wcmd); + + if (!rc) + return 260; + + rc = WaitForSingleObject(pi.hProcess, 5000); + + if (rc == WAIT_OBJECT_0) + GetExitCodeProcess(pi.hProcess, &rc); + else + TerminateProcess(pi.hProcess, 1); + + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + + return rc; +} + +static void test_hardlink(void) +{ + DWORD rc; + BOOL boolrc; + HANDLE hfile; + BY_HANDLE_FILE_INFORMATION info; + + hfile = CreateFileA("file", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + ok(hfile != INVALID_HANDLE_VALUE, "failed to create a file\n"); + CloseHandle(hfile); + + rc = runcmd("fsutil hardlink create link file"); + ok(rc == 0, "failed to create a hardlink\n"); + + hfile = CreateFileA("link", GENERIC_READ, 0, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, NULL); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open the hardlink\n"); + boolrc = GetFileInformationByHandle(hfile, &info); + ok(boolrc, "failed to get info about hardlink, error %#x\n", GetLastError()); + CloseHandle(hfile); + + ok(info.nNumberOfLinks == 2, "our link is not a hardlink"); + + rc = runcmd("fsutil hardlink create link file"); + ok(rc == 1, "fsutil didn't complain about already existing destination\n"); + + rc = runcmd("fsutil hardlink create newlink nonexistingfile"); + ok(rc == 1, "fsutil didn't complain about nonexisting source file\n"); + + boolrc = DeleteFileA("link"); + ok(boolrc, "failed to delete the hardlink, error %#x\n", GetLastError()); + boolrc = DeleteFileA("file"); + ok(boolrc, "failed to delete the file, error %#x\n", GetLastError()); +} + +START_TEST(fsutil) +{ + char tmpdir[MAX_PATH]; + + GetTempPathA(MAX_PATH, tmpdir); + SetCurrentDirectoryA(tmpdir); + + test_hardlink(); +}