<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it">
	<id>https://www.gambas-it.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Readlink_%28%29</id>
	<title>Readlink () - Cronologia</title>
	<link rel="self" type="application/atom+xml" href="https://www.gambas-it.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Readlink_%28%29"/>
	<link rel="alternate" type="text/html" href="https://www.gambas-it.org/wiki/index.php?title=Readlink_()&amp;action=history"/>
	<updated>2026-10-23T06:26:53Z</updated>
	<subtitle>Cronologia della pagina su questo sito</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>https://www.gambas-it.org/wiki/index.php?title=Readlink_()&amp;diff=40752&amp;oldid=prev</id>
		<title>Vuott: Creata pagina con &quot;La funzione esterna '''readlink()''', dichiarata nel file header ''/usr/include/unistd.h'':  ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.gambas-it.org/wiki/index.php?title=Readlink_()&amp;diff=40752&amp;oldid=prev"/>
		<updated>2025-01-03T23:59:15Z</updated>

		<summary type="html">&lt;p&gt;Creata pagina con &amp;quot;La funzione esterna &amp;#039;&amp;#039;&amp;#039;readlink()&amp;#039;&amp;#039;&amp;#039;, dichiarata nel file header &amp;#039;&amp;#039;/usr/include/unistd.h&amp;#039;&amp;#039;:  ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nuova pagina&lt;/b&gt;&lt;/p&gt;&lt;div&gt;La funzione esterna '''readlink()''', dichiarata nel file header ''/usr/include/unistd.h'':&lt;br /&gt;
 ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __len)&lt;br /&gt;
legge i contenuti di un collegamento simbolico.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volendola utilizzare in Gambas, bisognerà dichiararla con ''Extern'', nonché dichiarare la libreria di C: ''libc.so.6'', nella quale la funzione è contenuta:&lt;br /&gt;
 Private &amp;lt;FONT color=#B22222&amp;gt;Extern readlink&amp;lt;/font&amp;gt;(__path As String, __buf As Byte[], __len As Long) As Long In &amp;quot;&amp;lt;FONT color=#B22222&amp;gt;libc:6&amp;lt;/font&amp;gt;&amp;quot;&lt;br /&gt;
Semplice esempio di uso in Gambas:&lt;br /&gt;
 Library &amp;quot;libc:6&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;FONT Color=gray&amp;gt;' ''ssize_t readlink (const char *path, char *buf, size_t len)''&lt;br /&gt;
 ' ''Read the contents of the symbolic link PATH into no more than LEN bytes of BUF.''&amp;lt;/font&amp;gt;&lt;br /&gt;
 Private Extern readlink(path As String, buf As Byte[], _len As Long) As Long&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 Public Sub Main()&lt;br /&gt;
 &lt;br /&gt;
  Dim buf As New Byte[32]&lt;br /&gt;
  Dim sl As String&lt;br /&gt;
  Dim l As Long&lt;br /&gt;
 &lt;br /&gt;
  sl = &amp;quot;&amp;lt;FONT Color=darkgreen&amp;gt;''/percorso/del/collegamento/simbolico''&amp;lt;/font&amp;gt;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
  l = &amp;lt;FONT color=red&amp;gt;readlink&amp;lt;/font&amp;gt;(sl, buf, buf.Count) &lt;br /&gt;
 &lt;br /&gt;
  Print buf.ToString(0, l)&lt;br /&gt;
 &lt;br /&gt;
 End&lt;/div&gt;</summary>
		<author><name>Vuott</name></author>
	</entry>
</feed>