/usr/share/gir-1.0/GSystem-1.0.gir is in libgsystem-dev 2015.2+deb-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 | <?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations. -->
<repository version="1.2"
xmlns="http://www.gtk.org/introspection/core/1.0"
xmlns:c="http://www.gtk.org/introspection/c/1.0"
xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<include name="Gio" version="2.0"/>
<package name="libgsystem"/>
<namespace name="GSystem"
version="1.0"
shared-library="libgsystem.so.0"
c:identifier-prefixes="GS"
c:symbol-prefixes="gs">
<class name="Console"
c:symbol-prefix="console"
c:type="GSConsole"
parent="GObject.Object"
glib:type-name="GSConsole"
glib:get-type="gs_console_get_type">
<doc xml:space="preserve">First, this class offers API to access the standard input and
output/error, streams as #GInputStream and #GOutputStream
respectively.
In the case where the process is connected to a controlling
terminal, the gs_console_get() API is available, which exposes a
number of additional features such as no-echo password reading.</doc>
<function name="get" c:identifier="gs_console_get" version="2.36">
<doc xml:space="preserve">If the current process has an interactive console, return the
singleton #GSConsole instance. On Unix, this is equivalent to
isatty(). For all other cases, such as pipes, sockets, /dev/null,
this function will return %NULL.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">The console instance, or %NULL if not interactive</doc>
<type name="Console" c:type="GSConsole*"/>
</return-value>
</function>
<function name="get_stderr" c:identifier="gs_console_get_stderr">
<return-value transfer-ownership="none">
<doc xml:space="preserve">The singleton stream connected to standard error</doc>
<type name="Gio.OutputStream" c:type="GOutputStream*"/>
</return-value>
</function>
<function name="get_stdin" c:identifier="gs_console_get_stdin">
<return-value transfer-ownership="none">
<doc xml:space="preserve">The singleton stream connected to standard input</doc>
<type name="Gio.InputStream" c:type="GInputStream*"/>
</return-value>
</function>
<function name="get_stdout" c:identifier="gs_console_get_stdout">
<return-value transfer-ownership="none">
<doc xml:space="preserve">The singleton stream connected to standard output</doc>
<type name="Gio.OutputStream" c:type="GOutputStream*"/>
</return-value>
</function>
<method name="begin_status_line"
c:identifier="gs_console_begin_status_line"
throws="1">
<doc xml:space="preserve">The primary use case for this function is to output periodic
"status" or "progress" information. The first time this function
is called, @line will be output normally. Subsequent invocations
will overwrite the previous.
You must invoke gs_console_end_status_line() to return the console
to normal mode. In particular, concurrent use of this function and
the stream returned by gs_console_get_stdout() results in undefined
behavior.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="console" transfer-ownership="none">
<doc xml:space="preserve">the #GSConsole</doc>
<type name="Console" c:type="GSConsole*"/>
</instance-parameter>
<parameter name="line" transfer-ownership="none">
<doc xml:space="preserve">String to output</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</method>
<method name="end_status_line"
c:identifier="gs_console_end_status_line"
throws="1">
<doc xml:space="preserve">Complete a series of invocations of gs_console_begin_status_line(),
returning the stream to normal mode. The last printed status line
remains on the console; if this is not desired, print an empty
string to clear it before invoking this function.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="console" transfer-ownership="none">
<doc xml:space="preserve">the #GSConsole</doc>
<type name="Console" c:type="GSConsole*"/>
</instance-parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</method>
<method name="read_password"
c:identifier="gs_console_read_password"
throws="1">
<doc xml:space="preserve">Write @prompt to standard output, then switch output echo off, read
a result string, then switch output echo back on.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A string, or %NULL on error</doc>
<type name="utf8" c:type="char*"/>
</return-value>
<parameters>
<instance-parameter name="console" transfer-ownership="none">
<doc xml:space="preserve">the #GSConsole</doc>
<type name="Console" c:type="GSConsole*"/>
</instance-parameter>
<parameter name="prompt" transfer-ownership="none">
<doc xml:space="preserve">A string to output before reading the password</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</method>
</class>
<record name="DirFdIterator" c:type="GSDirFdIterator">
<field name="initialized" writable="1">
<type name="gboolean" c:type="gboolean"/>
</field>
<field name="fd" writable="1">
<type name="gint" c:type="int"/>
</field>
<field name="padding_data" writable="1">
<array zero-terminated="0" c:type="gpointer" fixed-size="4">
<type name="gpointer" c:type="gpointer"/>
</array>
</field>
</record>
<class name="Subprocess"
c:symbol-prefix="subprocess"
c:type="GSSubprocess"
parent="GObject.Object"
glib:type-name="GSSubprocess"
glib:get-type="gs_subprocess_get_type">
<doc xml:space="preserve">This class wraps the lower-level g_spawn_async_with_pipes() API,
providing a more modern GIO-style API, such as returning
#GInputStream objects for child output pipes.
One major advantage that GIO brings over the core GLib library is
comprehensive API for asynchronous I/O, such
g_output_stream_splice_async(). This makes GSubprocess
significantly more powerful and flexible than equivalent APIs in
some other languages such as the <literal>subprocess.py</literal>
included with Python. For example, using #GSubprocess one could
create two child processes, reading standard output from the first,
processing it, and writing to the input stream of the second, all
without blocking the main loop.</doc>
<implements name="Gio.Initable"/>
<constructor name="new"
c:identifier="gs_subprocess_new"
version="2.36"
throws="1">
<doc xml:space="preserve">Create a new process, using the parameters specified by
GSSubprocessContext.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A newly created %GSSubprocess, or %NULL on error (and @error will be set)</doc>
<type name="Subprocess" c:type="GSSubprocess*"/>
</return-value>
<parameters>
<parameter name="context" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</constructor>
<constructor name="new_simple_argl"
c:identifier="gs_subprocess_new_simple_argl"
introspectable="0">
<return-value transfer-ownership="full">
<type name="Subprocess" c:type="GSSubprocess*"/>
</return-value>
<parameters>
<parameter name="stdout_disposition" transfer-ownership="none">
<type name="SubprocessStreamDisposition"
c:type="GSSubprocessStreamDisposition"/>
</parameter>
<parameter name="stderr_disposition" transfer-ownership="none">
<type name="SubprocessStreamDisposition"
c:type="GSSubprocessStreamDisposition"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
<parameter name="error" transfer-ownership="none">
<type name="GLib.Error" c:type="GError**"/>
</parameter>
<parameter name="first_arg" transfer-ownership="none">
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="..." transfer-ownership="none">
<varargs/>
</parameter>
</parameters>
</constructor>
<constructor name="new_simple_argv"
c:identifier="gs_subprocess_new_simple_argv"
throws="1">
<doc xml:space="preserve">Create a new subprocess using the provided argument array and
stream dispositions.</doc>
<return-value transfer-ownership="full">
<type name="Subprocess" c:type="GSSubprocess*"/>
</return-value>
<parameters>
<parameter name="argv" transfer-ownership="none">
<doc xml:space="preserve">Argument array</doc>
<array c:type="char**">
<type name="utf8"/>
</array>
</parameter>
<parameter name="stdout_disposition" transfer-ownership="none">
<doc xml:space="preserve">Where to redirect stdout</doc>
<type name="SubprocessStreamDisposition"
c:type="GSSubprocessStreamDisposition"/>
</parameter>
<parameter name="stderr_disposition" transfer-ownership="none">
<doc xml:space="preserve">Where to redirect stderr</doc>
<type name="SubprocessStreamDisposition"
c:type="GSSubprocessStreamDisposition"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</constructor>
<function name="simple_run_sync"
c:identifier="gs_subprocess_simple_run_sync"
introspectable="0">
<doc xml:space="preserve">Run a process synchronously, throw an error if it fails.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="cwd" transfer-ownership="none">
<doc xml:space="preserve">Current working directory</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="stdin_disposition" transfer-ownership="none">
<doc xml:space="preserve">What to do with standard input</doc>
<type name="SubprocessStreamDisposition"
c:type="GSSubprocessStreamDisposition"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
<parameter name="error" transfer-ownership="none">
<doc xml:space="preserve">a #GError</doc>
<type name="GLib.Error" c:type="GError**"/>
</parameter>
<parameter name="first_arg" transfer-ownership="none">
<doc xml:space="preserve">First argument</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="..." transfer-ownership="none">
<doc xml:space="preserve">Remaining arguments, %NULL terminated</doc>
<varargs/>
</parameter>
</parameters>
</function>
<method name="force_exit" c:identifier="gs_subprocess_force_exit">
<doc xml:space="preserve">Use an operating-system specific method to attempt an immediate,
forceful termination of the process. There is no mechanism to
determine whether or not the request itself was successful;
however, you can use gs_subprocess_wait() to monitor the status of
the process after calling this function.
On Unix, this function sends %SIGKILL.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve">a #GSSubprocess</doc>
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_pid"
c:identifier="gs_subprocess_get_pid"
version="2.36">
<doc xml:space="preserve">The identifier for this child process; it is valid as long as the
process @self is referenced. In particular, do
<emphasis>not</emphasis> call g_spawn_close_pid() on this value;
that is handled internally.
On some Unix versions, it is possible for there to be a race
condition where waitpid() may have been called to collect the child
before any watches (such as that installed by
gs_subprocess_add_watch()) have fired. If you are planning to use
native functions such as kill() on the pid, your program should
gracefully handle an %ESRCH result to mitigate this.
If you want to request process termination, using the high level
gs_subprocess_request_exit() and gs_subprocess_force_exit() API is
recommended.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">Operating-system specific identifier for child process</doc>
<type name="GLib.Pid" c:type="GPid"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve">a #GSSubprocess</doc>
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_stderr_pipe"
c:identifier="gs_subprocess_get_stderr_pipe">
<return-value transfer-ownership="none">
<doc xml:space="preserve">Pipe</doc>
<type name="Gio.InputStream" c:type="GInputStream*"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_stdin_pipe"
c:identifier="gs_subprocess_get_stdin_pipe">
<return-value transfer-ownership="none">
<doc xml:space="preserve">Pipe</doc>
<type name="Gio.OutputStream" c:type="GOutputStream*"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_stdout_pipe"
c:identifier="gs_subprocess_get_stdout_pipe">
<return-value transfer-ownership="none">
<doc xml:space="preserve">Pipe</doc>
<type name="Gio.InputStream" c:type="GInputStream*"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
</parameters>
</method>
<method name="request_exit"
c:identifier="gs_subprocess_request_exit"
version="2.36">
<doc xml:space="preserve">This API uses an operating-system specific mechanism to request
that the subprocess gracefully exit. This API is not available on
all operating systems; for those not supported, it will do nothing
and return %FALSE. Portable code should handle this situation
gracefully. For example, if you are communicating via input or
output pipe with the child, many programs will automatically exit
when one of their standard input or output are closed.
On Unix, this API sends %SIGTERM.
A %TRUE return value does <emphasis>not</emphasis> mean the
subprocess has exited, merely that an exit request was initiated.
You can use gs_subprocess_add_watch() to monitor the status of the
process after calling this function.
This function returns %TRUE if the process has already exited.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if the operation is supported, %FALSE otherwise.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve">a #GSSubprocess</doc>
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
</parameters>
</method>
<method name="wait" c:identifier="gs_subprocess_wait" version="2.36">
<doc xml:space="preserve">Start an asynchronous wait for the subprocess @self to exit.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve">a #GSSubprocess</doc>
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
<parameter name="callback"
transfer-ownership="none"
nullable="1"
allow-none="1"
scope="async"
closure="2">
<doc xml:space="preserve">Invoked when process exits, or @cancellable is cancelled</doc>
<type name="Gio.AsyncReadyCallback" c:type="GAsyncReadyCallback"/>
</parameter>
<parameter name="user_data" transfer-ownership="none">
<doc xml:space="preserve">Data for @callback</doc>
<type name="gpointer" c:type="gpointer"/>
</parameter>
</parameters>
</method>
<method name="wait_finish"
c:identifier="gs_subprocess_wait_finish"
version="2.36"
throws="1">
<doc xml:space="preserve">The exit status of the process will be stored in @out_exit_status.
See the documentation of g_spawn_check_exit_status() for more
details.
Note that @error is not set if the process exits abnormally; you
must use g_spawn_check_exit_status() for that.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve">a #GSSubprocess</doc>
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
<parameter name="result" transfer-ownership="none">
<doc xml:space="preserve">a #GAsyncResult</doc>
<type name="Gio.AsyncResult" c:type="GAsyncResult*"/>
</parameter>
<parameter name="out_exit_status"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">Exit status of the process encoded in platform-specific way</doc>
<type name="gint" c:type="int*"/>
</parameter>
</parameters>
</method>
<method name="wait_sync"
c:identifier="gs_subprocess_wait_sync"
version="2.36"
throws="1">
<doc xml:space="preserve">Synchronously wait for the subprocess to terminate, returning the
status code in @out_exit_status. See the documentation of
g_spawn_check_exit_status() for how to interpret it. Note that if
@error is set, then @out_exit_status will be left uninitialized.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE if @cancellable was cancelled</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve">a #GSSubprocess</doc>
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
<parameter name="out_exit_status"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">Platform-specific exit code</doc>
<type name="gint" c:type="int*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</method>
<method name="wait_sync_check"
c:identifier="gs_subprocess_wait_sync_check"
version="2.36"
throws="1">
<doc xml:space="preserve">Combines gs_subprocess_wait_sync() with g_spawn_check_exit_status().</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE if process exited abnormally, or @cancellable was cancelled</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve">a #GSSubprocess</doc>
<type name="Subprocess" c:type="GSSubprocess*"/>
</instance-parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</method>
<property name="context"
version="2.36"
writable="1"
construct-only="1"
transfer-ownership="none">
<type name="SubprocessContext"/>
</property>
</class>
<class name="SubprocessContext"
c:symbol-prefix="subprocess_context"
c:type="GSSubprocessContext"
parent="GObject.Object"
glib:type-name="GSSubprocessContext"
glib:get-type="gs_subprocess_context_get_type">
<doc xml:space="preserve">This class contains a set of options for launching child processes,
such as where its standard input and output will be directed, the
argument list, the environment, and more.
While the #GSSubprocess class has high level functions covering
popular cases, use of this class allows access to more advanced
options. It can also be used to launch multiple subprocesses with
a similar configuration.</doc>
<constructor name="new" c:identifier="gs_subprocess_context_new">
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new instance of a #GSSubprocessContext.</doc>
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</return-value>
<parameters>
<parameter name="argv" transfer-ownership="none">
<doc xml:space="preserve">Argument list</doc>
<type name="utf8" c:type="gchar**"/>
</parameter>
</parameters>
</constructor>
<constructor name="new_argv0"
c:identifier="gs_subprocess_context_new_argv0">
<return-value transfer-ownership="full">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</return-value>
<parameters>
<parameter name="argv0" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="argv" transfer-ownership="none">
<type name="utf8" c:type="gchar**"/>
</parameter>
</parameters>
</constructor>
<constructor name="newv"
c:identifier="gs_subprocess_context_newv"
introspectable="0">
<return-value transfer-ownership="full">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</return-value>
<parameters>
<parameter name="first_arg" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="..." transfer-ownership="none">
<varargs/>
</parameter>
</parameters>
</constructor>
<function name="newa"
c:identifier="gs_subprocess_context_newa"
introspectable="0">
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new instance of a #GSSubprocessContext.</doc>
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</return-value>
<parameters>
<parameter name="first_arg" transfer-ownership="none">
<doc xml:space="preserve">First argument</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="args" transfer-ownership="none">
<doc xml:space="preserve">a va_list</doc>
<type name="va_list" c:type="va_list"/>
</parameter>
</parameters>
</function>
<method name="argv_append"
c:identifier="gs_subprocess_context_argv_append">
<doc xml:space="preserve">Append an argument to the child's argument vector.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="arg" transfer-ownership="none">
<doc xml:space="preserve">An argument</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="open_pipe_read"
c:identifier="gs_subprocess_context_open_pipe_read"
throws="1">
<doc xml:space="preserve">This allows you to open a pipe between the parent and child
processes, independent of the standard streams. For this function,
the pipe is set up so that the parent can read, and the child can
write. For the opposite version, see
gs_subprocess_context_open_pipe_write().
The returned @out_fdno is the file descriptor number that the child
will see; you need to communicate this number via a separate
channel, such as the argument list. For example, if you're using
this pipe to send a password, provide
<literal>--password-fd=&lt;fdno string&gt;</literal>.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on error (and @error will be set)</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="out_stream"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">A newly referenced output stream</doc>
<type name="Gio.InputStream" c:type="GInputStream**"/>
</parameter>
<parameter name="out_fdno"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">File descriptor number for the subprocess side of the pipe</doc>
<type name="gint" c:type="gint*"/>
</parameter>
</parameters>
</method>
<method name="open_pipe_write"
c:identifier="gs_subprocess_context_open_pipe_write"
throws="1">
<doc xml:space="preserve">Like gs_subprocess_context_open_pipe_read(), but returns a writable
channel from which the child process can read.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on error (and @error will be set)</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="out_stream"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">A newly referenced stream</doc>
<type name="Gio.OutputStream" c:type="GOutputStream**"/>
</parameter>
<parameter name="out_fdno"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">File descriptor number for the subprocess side of the pipe</doc>
<type name="gint" c:type="gint*"/>
</parameter>
</parameters>
</method>
<method name="set_child_setup"
c:identifier="gs_subprocess_context_set_child_setup"
introspectable="0">
<doc xml:space="preserve">FIXME - note extensive restricitons on GSpawnChildSetupFunc here</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="child_setup" transfer-ownership="none" closure="1">
<doc xml:space="preserve">Function to call in the newly forked child, before execve()</doc>
<type name="GLib.SpawnChildSetupFunc"
c:type="GSpawnChildSetupFunc"/>
</parameter>
<parameter name="user_data" transfer-ownership="none">
<doc xml:space="preserve">Data passed to child</doc>
<type name="gpointer" c:type="gpointer"/>
</parameter>
</parameters>
</method>
<method name="set_cwd" c:identifier="gs_subprocess_context_set_cwd">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="cwd" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="set_environment"
c:identifier="gs_subprocess_context_set_environment">
<doc xml:space="preserve">Replace the environment that will be used for the child process.
The default is to inherit the current process.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="environ" transfer-ownership="none">
<doc xml:space="preserve">Environment KEY=VALUE pairs</doc>
<array c:type="gchar**">
<type name="utf8"/>
</array>
</parameter>
</parameters>
</method>
<method name="set_keep_descriptors"
c:identifier="gs_subprocess_context_set_keep_descriptors">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="keep_descriptors" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
</parameters>
</method>
<method name="set_search_path"
c:identifier="gs_subprocess_context_set_search_path">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="search_path" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
<parameter name="search_path_from_envp" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
</parameters>
</method>
<method name="set_stderr_disposition"
c:identifier="gs_subprocess_context_set_stderr_disposition">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="disposition" transfer-ownership="none">
<type name="SubprocessStreamDisposition"
c:type="GSSubprocessStreamDisposition"/>
</parameter>
</parameters>
</method>
<method name="set_stderr_fd"
c:identifier="gs_subprocess_context_set_stderr_fd">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="fd" transfer-ownership="none">
<type name="gint" c:type="gint"/>
</parameter>
</parameters>
</method>
<method name="set_stderr_file_path"
c:identifier="gs_subprocess_context_set_stderr_file_path">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="path" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="set_stdin_disposition"
c:identifier="gs_subprocess_context_set_stdin_disposition">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="disposition" transfer-ownership="none">
<type name="SubprocessStreamDisposition"
c:type="GSSubprocessStreamDisposition"/>
</parameter>
</parameters>
</method>
<method name="set_stdin_fd"
c:identifier="gs_subprocess_context_set_stdin_fd">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="fd" transfer-ownership="none">
<type name="gint" c:type="gint"/>
</parameter>
</parameters>
</method>
<method name="set_stdin_file_path"
c:identifier="gs_subprocess_context_set_stdin_file_path">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="path" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="set_stdout_disposition"
c:identifier="gs_subprocess_context_set_stdout_disposition">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="disposition" transfer-ownership="none">
<type name="SubprocessStreamDisposition"
c:type="GSSubprocessStreamDisposition"/>
</parameter>
</parameters>
</method>
<method name="set_stdout_fd"
c:identifier="gs_subprocess_context_set_stdout_fd">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="fd" transfer-ownership="none">
<type name="gint" c:type="gint"/>
</parameter>
</parameters>
</method>
<method name="set_stdout_file_path"
c:identifier="gs_subprocess_context_set_stdout_file_path">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<type name="SubprocessContext" c:type="GSSubprocessContext*"/>
</instance-parameter>
<parameter name="path" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<property name="argv"
version="2.36"
writable="1"
transfer-ownership="none">
<doc xml:space="preserve">Array of arguments passed to child process; must have at least
one element. The first element has special handling - if it is
an not absolute path ( as determined by g_path_is_absolute() ),
then the system search path will be used. See
%G_SPAWN_SEARCH_PATH.
Note that in order to use the Unix-specific argv0 functionality,
you must use the setter function
gs_subprocess_context_set_args_and_argv0(). For more information
about this, see %G_SPAWN_FILE_AND_ARGV_ZERO.</doc>
<array>
<type name="utf8"/>
</array>
</property>
</class>
<enumeration name="SubprocessStreamDisposition"
version="2.36"
c:type="GSSubprocessStreamDisposition">
<doc xml:space="preserve">Flags to define the behaviour of the standard input/output/error of
a #GSSubprocess.</doc>
<member name="null"
value="0"
c:identifier="GS_SUBPROCESS_STREAM_DISPOSITION_NULL">
<doc xml:space="preserve">Redirect to operating system's null output stream</doc>
</member>
<member name="inherit"
value="1"
c:identifier="GS_SUBPROCESS_STREAM_DISPOSITION_INHERIT">
<doc xml:space="preserve">Keep the stream from the parent process</doc>
</member>
<member name="pipe"
value="2"
c:identifier="GS_SUBPROCESS_STREAM_DISPOSITION_PIPE">
<doc xml:space="preserve">Open a private unidirectional channel between the processes</doc>
</member>
<member name="stderr_merge"
value="3"
c:identifier="GS_SUBPROCESS_STREAM_DISPOSITION_STDERR_MERGE">
<doc xml:space="preserve">Only applicable to standard error; causes it to be merged with standard output</doc>
</member>
</enumeration>
<function name="dfd_and_name_get_all_xattrs"
c:identifier="gs_dfd_and_name_get_all_xattrs"
throws="1">
<doc xml:space="preserve">Load all extended attributes for the file named @name residing in
directory @dfd.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="dfd" transfer-ownership="none">
<doc xml:space="preserve">Parent directory file descriptor</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="name" transfer-ownership="none">
<doc xml:space="preserve">File name</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="out_xattrs"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">Extended attribute set</doc>
<type name="GLib.Variant" c:type="GVariant**"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Cancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="dfd_and_name_set_all_xattrs"
c:identifier="gs_dfd_and_name_set_all_xattrs"
throws="1">
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="dfd" transfer-ownership="none">
<type name="gint" c:type="int"/>
</parameter>
<parameter name="name" transfer-ownership="none">
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="xattrs" transfer-ownership="none">
<type name="GLib.Variant" c:type="GVariant*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="dirfd_iterator_clear"
c:identifier="gs_dirfd_iterator_clear">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="dfd_iter" transfer-ownership="none">
<type name="DirFdIterator" c:type="GSDirFdIterator*"/>
</parameter>
</parameters>
</function>
<function name="dirfd_iterator_init_at"
c:identifier="gs_dirfd_iterator_init_at"
throws="1">
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="dfd" transfer-ownership="none">
<type name="gint" c:type="int"/>
</parameter>
<parameter name="path" transfer-ownership="none">
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="follow" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
<parameter name="dfd_iter" transfer-ownership="none">
<type name="DirFdIterator" c:type="GSDirFdIterator*"/>
</parameter>
</parameters>
</function>
<function name="dirfd_iterator_init_take_fd"
c:identifier="gs_dirfd_iterator_init_take_fd"
throws="1">
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="dfd" transfer-ownership="none">
<type name="gint" c:type="int"/>
</parameter>
<parameter name="dfd_iter" transfer-ownership="none">
<type name="DirFdIterator" c:type="GSDirFdIterator*"/>
</parameter>
</parameters>
</function>
<function name="fd_get_all_xattrs"
c:identifier="gs_fd_get_all_xattrs"
throws="1">
<doc xml:space="preserve">Read all extended attributes from @fd in a canonical sorted order, and
set @out_xattrs with the result.
If the filesystem does not support extended attributes, @out_xattrs
will have 0 elements, and this function will return successfully.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="fd" transfer-ownership="none">
<doc xml:space="preserve">a file descriptor</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="out_xattrs"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">A new #GVariant containing the extended attributes</doc>
<type name="GLib.Variant" c:type="GVariant**"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Cancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="fd_set_all_xattrs"
c:identifier="gs_fd_set_all_xattrs"
throws="1">
<doc xml:space="preserve">For each attribute in @xattrs, set its value on the file or
directory referred to by @fd. This function does not remove any
attributes not in @xattrs.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="fd" transfer-ownership="none">
<doc xml:space="preserve">File descriptor</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="xattrs" transfer-ownership="none">
<doc xml:space="preserve">Extended attributes</doc>
<type name="GLib.Variant" c:type="GVariant*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Cancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_chmod" c:identifier="gs_file_chmod" throws="1">
<doc xml:space="preserve">Merely wraps UNIX chmod().</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on error</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">Path to file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="mode" transfer-ownership="none">
<doc xml:space="preserve">UNIX mode</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_chown" c:identifier="gs_file_chown" throws="1">
<doc xml:space="preserve">Merely wraps UNIX chown().</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on error</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">Path to file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="owner" transfer-ownership="none">
<doc xml:space="preserve">UNIX owner</doc>
<type name="guint32" c:type="guint32"/>
</parameter>
<parameter name="group" transfer-ownership="none">
<doc xml:space="preserve">UNIX group</doc>
<type name="guint32" c:type="guint32"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_create" c:identifier="gs_file_create" throws="1">
<doc xml:space="preserve">Like g_file_create(), except this function allows specifying the
access mode. This allows atomically creating private files.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<doc xml:space="preserve">Path to non-existent file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="mode" transfer-ownership="none">
<doc xml:space="preserve">Unix access permissions</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="out_stream"
direction="out"
caller-allocates="0"
transfer-ownership="full"
optional="1"
allow-none="1">
<doc xml:space="preserve">Newly created output, or %NULL</doc>
<type name="Gio.OutputStream" c:type="GOutputStream**"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_ensure_directory"
c:identifier="gs_file_ensure_directory"
throws="1">
<doc xml:space="preserve">Like g_file_make_directory(), except does not throw an error if the
directory already exists.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="dir" transfer-ownership="none">
<doc xml:space="preserve">Path to create as directory</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="with_parents" transfer-ownership="none">
<doc xml:space="preserve">Also create parent directories</doc>
<type name="gboolean" c:type="gboolean"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_ensure_directory_mode"
c:identifier="gs_file_ensure_directory_mode"
throws="1">
<doc xml:space="preserve">Wraps UNIX mkdir() function with support for @cancellable, and
uses @error instead of errno.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="dir" transfer-ownership="none">
<doc xml:space="preserve">Path to create as directory</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="mode" transfer-ownership="none">
<doc xml:space="preserve">Create directory with these permissions</doc>
<type name="guint" c:type="guint"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_enumerator_iterate"
c:identifier="gs_file_enumerator_iterate"
throws="1">
<doc xml:space="preserve">This is a version of g_file_enumerator_next_file() that's easier to
use correctly from C programs. With g_file_enumerator_next_file(),
the gboolean return value signifies "end of iteration or error", which
requires allocation of a temporary #GError.
In contrast, with this function, a %FALSE return from
gs_file_enumerator_iterate() <emphasis>always</emphasis> means
"error". End of iteration is signaled by @out_info being %NULL.
Another crucial difference is that the references for @out_info and
@out_child are owned by @direnum (they are cached as hidden
properties). You must not unref them in your own code. This makes
memory management significantly easier for C code in combination
with loops.
Finally, this function optionally allows retrieving a #GFile as
well.
The code pattern for correctly using gs_file_enumerator_iterate() from C
is:
|[
direnum = g_file_enumerate_children (file, ...);
while (TRUE)
{
GFileInfo *info;
if (!gs_file_enumerator_iterate (direnum, &info, NULL, cancellable, error))
goto out;
if (!info)
break;
... do stuff with "info"; do not unref it! ...
}
out:
g_object_unref (direnum); // Note: frees the last @info
]|</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="direnum" transfer-ownership="none">
<doc xml:space="preserve">an open #GFileEnumerator</doc>
<type name="Gio.FileEnumerator" c:type="GFileEnumerator*"/>
</parameter>
<parameter name="out_info"
direction="out"
caller-allocates="0"
transfer-ownership="none"
optional="1"
allow-none="1">
<doc xml:space="preserve">Output location for the next #GFileInfo</doc>
<type name="Gio.FileInfo" c:type="GFileInfo**"/>
</parameter>
<parameter name="out_child"
direction="out"
caller-allocates="0"
transfer-ownership="none"
optional="1"
allow-none="1">
<doc xml:space="preserve">Output location for the next #GFile, or %NULL</doc>
<type name="Gio.File" c:type="GFile**"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_get_all_xattrs"
c:identifier="gs_file_get_all_xattrs"
throws="1">
<doc xml:space="preserve">Read all extended attributes of @f in a canonical sorted order, and
set @out_xattrs with the result.
If the filesystem does not support extended attributes, @out_xattrs
will have 0 elements, and this function will return successfully.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="f" transfer-ownership="none">
<doc xml:space="preserve">a #GFile</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="out_xattrs"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">A new #GVariant containing the extended attributes</doc>
<type name="GLib.Variant" c:type="GVariant**"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Cancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_get_basename_cached"
c:identifier="gs_file_get_basename_cached">
<doc xml:space="preserve">Like g_file_get_basename(), but returns a constant copy so callers
don't need to free the result.</doc>
<return-value transfer-ownership="none">
<type name="utf8" c:type="const char*"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<type name="Gio.File" c:type="GFile*"/>
</parameter>
</parameters>
</function>
<function name="file_get_path_cached"
c:identifier="gs_file_get_path_cached">
<doc xml:space="preserve">Like g_file_get_path(), but returns a constant copy so callers
don't need to free the result.</doc>
<return-value transfer-ownership="none">
<type name="utf8" c:type="const char*"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<type name="Gio.File" c:type="GFile*"/>
</parameter>
</parameters>
</function>
<function name="file_get_relpath" c:identifier="gs_file_get_relpath">
<doc xml:space="preserve">Like gs_file_get_relative_path(), but does not mandate that
the two files have any parent in common. This function will
instead insert "../" where appropriate.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">The relative path between the two.</doc>
<type name="utf8" c:type="gchar*"/>
</return-value>
<parameters>
<parameter name="one" transfer-ownership="none">
<doc xml:space="preserve">The first #GFile</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="two" transfer-ownership="none">
<doc xml:space="preserve">The second #GFile</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
</parameters>
</function>
<function name="file_lchown" c:identifier="gs_file_lchown" throws="1">
<doc xml:space="preserve">Merely wraps UNIX lchown().</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on error</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">Path to file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="owner" transfer-ownership="none">
<doc xml:space="preserve">UNIX owner</doc>
<type name="guint32" c:type="guint32"/>
</parameter>
<parameter name="group" transfer-ownership="none">
<doc xml:space="preserve">UNIX group</doc>
<type name="guint32" c:type="guint32"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_linkcopy" c:identifier="gs_file_linkcopy" throws="1">
<doc xml:space="preserve">First tries to use the UNIX link() call, but if the files are on
separate devices, fall back to copying via g_file_copy().
The given @flags have different semantics than those documented
when hardlinking is used. Specifically, both
#G_FILE_COPY_TARGET_DEFAULT_PERMS and #G_FILE_COPY_BACKUP are not
supported. #G_FILE_COPY_NOFOLLOW_SYMLINKS treated as if it was
always given - if you want to follow symbolic links, you will need
to resolve them manually.
Beware - do not use this function if @src may be modified, and it's
undesirable for the changes to also be reflected in @dest. The
best use of this function is in the case where @src and @dest are
read-only, or where @src is a temporary file, and you want to put
it in the final place.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="src" transfer-ownership="none">
<doc xml:space="preserve">Source file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="dest" transfer-ownership="none">
<doc xml:space="preserve">Destination file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="flags" transfer-ownership="none">
<doc xml:space="preserve">flags</doc>
<type name="Gio.FileCopyFlags" c:type="GFileCopyFlags"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_linkcopy_sync_data"
c:identifier="gs_file_linkcopy_sync_data"
throws="1">
<doc xml:space="preserve">This function is similar to gs_file_linkcopy(), except it also uses
gs_file_sync_data() to ensure that @dest is in stable storage
before it is moved into place.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="src" transfer-ownership="none">
<doc xml:space="preserve">Source file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="dest" transfer-ownership="none">
<doc xml:space="preserve">Destination file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="flags" transfer-ownership="none">
<doc xml:space="preserve">flags</doc>
<type name="Gio.FileCopyFlags" c:type="GFileCopyFlags"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_load_contents_utf8"
c:identifier="gs_file_load_contents_utf8"
throws="1">
<doc xml:space="preserve">Like g_file_load_contents(), except validates the contents are
UTF-8.</doc>
<return-value transfer-ownership="full">
<type name="utf8" c:type="gchar*"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<doc xml:space="preserve">Path to file whose contents must be UTF-8</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_map_noatime"
c:identifier="gs_file_map_noatime"
introspectable="0"
throws="1">
<doc xml:space="preserve">Like g_mapped_file_new(), but try to avoid updating the file's
access time. This should be used by background scanning
components such as search indexers, antivirus programs, etc.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new mapped file, or %NULL on error</doc>
<type name="GLib.MappedFile" c:type="GMappedFile*"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<doc xml:space="preserve">a #GFile</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_map_readonly"
c:identifier="gs_file_map_readonly"
throws="1">
<doc xml:space="preserve">Return a #GBytes which references a readonly view of the contents of
@file. This function uses #GMappedFile internally.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a newly referenced #GBytes</doc>
<type name="GLib.Bytes" c:type="GBytes*"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<doc xml:space="preserve">a #GFile</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_open_dir_fd"
c:identifier="gs_file_open_dir_fd"
throws="1">
<doc xml:space="preserve">On success, sets @out_fd to a file descriptor for the directory
that can be used with UNIX functions such as openat().</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">Directory name</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="out_fd"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">File descriptor for directory</doc>
<type name="gint" c:type="int*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Cancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_open_dir_fd_at"
c:identifier="gs_file_open_dir_fd_at"
throws="1">
<doc xml:space="preserve">On success, sets @out_fd to a file descriptor for the directory
that can be used with UNIX functions such as openat().</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="parent_dfd" transfer-ownership="none">
<doc xml:space="preserve">Parent directory file descriptor</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="name" transfer-ownership="none">
<doc xml:space="preserve">Directory name</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="out_fd"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">File descriptor for directory</doc>
<type name="gint" c:type="int*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Cancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_open_in_tmpdir"
c:identifier="gs_file_open_in_tmpdir"
throws="1">
<doc xml:space="preserve">Like g_file_open_tmp(), except the file will be created in the
provided @tmpdir, and allows specification of the Unix @mode, which
means private files may be created. Return values will be stored
in @out_file, and optionally @out_stream.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="tmpdir" transfer-ownership="none">
<doc xml:space="preserve">Directory to place temporary file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="mode" transfer-ownership="none">
<doc xml:space="preserve">Default mode (will be affected by umask)</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="out_file"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">Newly created file path</doc>
<type name="Gio.File" c:type="GFile**"/>
</parameter>
<parameter name="out_stream"
direction="out"
caller-allocates="0"
transfer-ownership="full"
optional="1"
allow-none="1">
<doc xml:space="preserve">Newly created output stream</doc>
<type name="Gio.OutputStream" c:type="GOutputStream**"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_open_in_tmpdir_at"
c:identifier="gs_file_open_in_tmpdir_at"
throws="1">
<doc xml:space="preserve">Like g_file_open_tmp(), except the file will be created in the
provided @tmpdir, and allows specification of the Unix @mode, which
means private files may be created. Return values will be stored
in @out_name, and optionally @out_stream.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="tmpdir_fd" transfer-ownership="none">
<doc xml:space="preserve">Directory to place temporary file</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="mode" transfer-ownership="none">
<doc xml:space="preserve">Default mode (will be affected by umask)</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="out_name"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">Newly created file name</doc>
<type name="utf8" c:type="char**"/>
</parameter>
<parameter name="out_stream"
direction="out"
caller-allocates="0"
transfer-ownership="full"
optional="1"
allow-none="1">
<doc xml:space="preserve">Newly created output stream</doc>
<type name="Gio.OutputStream" c:type="GOutputStream**"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_openat_noatime"
c:identifier="gs_file_openat_noatime"
throws="1">
<doc xml:space="preserve">Wrapper for openat() using %O_RDONLY with %O_NOATIME if available.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="dfd" transfer-ownership="none">
<doc xml:space="preserve">File descriptor for directory</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="name" transfer-ownership="none">
<doc xml:space="preserve">Pathname, relative to @dfd</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="ret_fd"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">Returned file descriptor</doc>
<type name="gint" c:type="int*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Cancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_read_noatime"
c:identifier="gs_file_read_noatime"
throws="1">
<doc xml:space="preserve">Like g_file_read(), but try to avoid updating the file's
access time. This should be used by background scanning
components such as search indexers, antivirus programs, etc.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new input stream, or %NULL on error</doc>
<type name="Gio.InputStream" c:type="GInputStream*"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<doc xml:space="preserve">a #GFile</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_realpath" c:identifier="gs_file_realpath">
<doc xml:space="preserve">Return a #GFile that contains the same path with symlinks
followed. That is, it's a #GFile whose path is the result
of calling realpath() on @file.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new #GFile or %NULL if @file is invalid</doc>
<type name="Gio.File" c:type="GFile*"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<doc xml:space="preserve">A #GFile</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
</parameters>
</function>
<function name="file_rename" c:identifier="gs_file_rename" throws="1">
<doc xml:space="preserve">This function wraps the raw Unix function rename().</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on error</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="from" transfer-ownership="none">
<doc xml:space="preserve">Current path</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="to" transfer-ownership="none">
<doc xml:space="preserve">New path</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_set_all_xattrs"
c:identifier="gs_file_set_all_xattrs"
throws="1">
<doc xml:space="preserve">For each attribute in @xattrs, set its value on the file or
directory referred to by @file. This function does not remove any
attributes not in @xattrs.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<doc xml:space="preserve">File descriptor</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="xattrs" transfer-ownership="none">
<doc xml:space="preserve">Extended attributes</doc>
<type name="GLib.Variant" c:type="GVariant*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Cancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_sync_data"
c:identifier="gs_file_sync_data"
throws="1">
<doc xml:space="preserve">Wraps the UNIX fsync() function (or fdatasync(), if available), which
ensures that the data in @file is on non-volatile storage.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="file" transfer-ownership="none">
<doc xml:space="preserve">a #GFile</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="file_unlink" c:identifier="gs_file_unlink" throws="1">
<doc xml:space="preserve">Like g_file_delete(), except this function does not follow Unix
symbolic links, and will delete a symbolic link even if it's
pointing to a nonexistent file. In other words, this function
merely wraps the raw Unix function unlink().</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on error</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">Path to file</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="fileutil_gen_tmp_name"
c:identifier="gs_fileutil_gen_tmp_name">
<doc xml:space="preserve">Generate a name suitable for use as a temporary file. This
function does no I/O; it is not guaranteed that a file with that
name does not exist.</doc>
<return-value transfer-ownership="full">
<type name="utf8" c:type="char*"/>
</return-value>
<parameters>
<parameter name="prefix"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">String prepended to the result</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="suffix"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">String suffixed to the result</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
</parameters>
</function>
<function name="log_structured" c:identifier="gs_log_structured">
<doc xml:space="preserve">Log structured data in an operating-system specific fashion. The
parameter @opts should be an array of UTF-8 KEY=VALUE strings.
This function does not support binary data. See
http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html
for more information about fields that can be used on a systemd
system.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="message" transfer-ownership="none">
<doc xml:space="preserve">Text message to send</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="keys"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Optional structured data</doc>
<array c:type="char**">
<type name="utf8"/>
</array>
</parameter>
</parameters>
</function>
<function name="log_structured_print"
c:identifier="gs_log_structured_print">
<doc xml:space="preserve">Like gs_log_structured(), but also print to standard output (if it
is not already connected to the system log).</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="message" transfer-ownership="none">
<doc xml:space="preserve">A message to log</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="keys"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Optional structured data</doc>
<array c:type="char**">
<type name="utf8"/>
</array>
</parameter>
</parameters>
</function>
<function name="log_structured_print_id_v"
c:identifier="gs_log_structured_print_id_v"
introspectable="0">
<doc xml:space="preserve">The provided @message_id is a unique MESSAGE_ID (see <ulink url="http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html"> for more information).
This function otherwise acts as gs_log_structured_print(), taking
@format as a format string.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="message_id" transfer-ownership="none">
<doc xml:space="preserve">A unique MESSAGE_ID</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="format" transfer-ownership="none">
<doc xml:space="preserve">A format string</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="..." transfer-ownership="none">
<varargs/>
</parameter>
</parameters>
</function>
<function name="opendirat" c:identifier="gs_opendirat" throws="1">
<doc xml:space="preserve">Use openat() to open a directory, using a standard set of flags.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="dfd" transfer-ownership="none">
<doc xml:space="preserve">File descriptor for origin directory</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">Pathname, relative to @dfd</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="follow" transfer-ownership="none">
<doc xml:space="preserve">Whether or not to follow symbolic links</doc>
<type name="gboolean" c:type="gboolean"/>
</parameter>
<parameter name="out_fd" transfer-ownership="none">
<type name="gint" c:type="int*"/>
</parameter>
</parameters>
</function>
<function name="opendirat_with_errno"
c:identifier="gs_opendirat_with_errno">
<doc xml:space="preserve">Use openat() to open a directory, using a standard set of flags.
This function sets errno.</doc>
<return-value transfer-ownership="none">
<type name="gint" c:type="int"/>
</return-value>
<parameters>
<parameter name="dfd" transfer-ownership="none">
<doc xml:space="preserve">File descriptor for origin directory</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">Pathname, relative to @dfd</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="follow" transfer-ownership="none">
<doc xml:space="preserve">Whether or not to follow symbolic links</doc>
<type name="gboolean" c:type="gboolean"/>
</parameter>
</parameters>
</function>
<function name="set_error_from_errno"
c:identifier="gs_set_error_from_errno">
<doc xml:space="preserve">Set @error to an error with domain %G_IO_ERROR, and code based on
the value of @saved_errno. The error message is set using a
literal return from g_strerror().</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="error"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Error</doc>
<type name="GLib.Error" c:type="GError**"/>
</parameter>
<parameter name="saved_errno" transfer-ownership="none">
<doc xml:space="preserve">errno value</doc>
<type name="gint" c:type="gint"/>
</parameter>
</parameters>
</function>
<function name="set_prefix_error_from_errno"
c:identifier="gs_set_prefix_error_from_errno"
introspectable="0">
<doc xml:space="preserve">Set @error to an error with domain %G_IO_ERROR, and code based on
the value of @saved_errno. The error message is prefixed with the
result of @format, a colon and space, then the result of
g_strerror().</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="error"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Error</doc>
<type name="GLib.Error" c:type="GError**"/>
</parameter>
<parameter name="saved_errno" transfer-ownership="none">
<doc xml:space="preserve">errno value</doc>
<type name="gint" c:type="gint"/>
</parameter>
<parameter name="format" transfer-ownership="none">
<doc xml:space="preserve">Format string for printf</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="..." transfer-ownership="none">
<varargs/>
</parameter>
</parameters>
</function>
<function name="shutil_cp_a" c:identifier="gs_shutil_cp_a" throws="1">
<doc xml:space="preserve">Recursively copy path @src (which must be a directory) to the
target @dest. Any existing files are overwritten.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="src" transfer-ownership="none">
<doc xml:space="preserve">Source path</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="dest" transfer-ownership="none">
<doc xml:space="preserve">Destination path</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="shutil_cp_al_or_fallback"
c:identifier="gs_shutil_cp_al_or_fallback"
throws="1">
<doc xml:space="preserve">Recursively copy path @src (which must be a directory) to the
target @dest. If possible, hardlinks are used; if a hardlink is
not possible, a regular copy is created. Any existing files are
overwritten.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="src" transfer-ownership="none">
<doc xml:space="preserve">Source path</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="dest" transfer-ownership="none">
<doc xml:space="preserve">Destination path</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="shutil_rm_rf" c:identifier="gs_shutil_rm_rf" throws="1">
<doc xml:space="preserve">Recursively delete the filename referenced by @path; it may be a
file or directory. No error is thrown if @path does not exist.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">A file or directory</doc>
<type name="Gio.File" c:type="GFile*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="shutil_rm_rf_at"
c:identifier="gs_shutil_rm_rf_at"
throws="1">
<doc xml:space="preserve">Recursively delete the filename referenced by the combination of
the directory fd@dfd and @path; it may be a file or directory. No
error is thrown if @path does not exist.</doc>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="dfd" transfer-ownership="none">
<doc xml:space="preserve">A directory file descriptor, or -1 for current</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">Path</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">Cancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</function>
<function name="stdout_is_journal" c:identifier="gs_stdout_is_journal">
<doc xml:space="preserve">Use this function when you want your code to behave differently
depeneding on whether your program was started as a systemd unit,
or e.g. interactively at a terminal.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if stdout is (probably) connnected to the systemd journal</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
</function>
</namespace>
</repository>
|