<font color='black' size='2' face='arial'>
<div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">
<font face="arial" size="2"><font face="arial, helvetica"><span style="font-size: 10pt;">Hello everyone! Now i am trying (newbie) on Ubuntu Swift 3. I am trying to Read String from File Using FileHandle<br>
</span></font><br>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">import Foundation</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">let filemgr = FileManager.default</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">let filepath1 = "/home/roman/test"</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"><br>
</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">let file: FileHandle? = FileHandle(forReadingAtPath: filepath1)</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"><br>
</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">if file == nil {</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&nbsp; &nbsp; print("File open failed")</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">} else {</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&nbsp; &nbsp; let databuffer = file?.readDataToEndOfFile</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&nbsp; &nbsp; let String1 = String(databuffer, encoding: String.Encoding.utf8)</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&nbsp; &nbsp; file?.closeFile()</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&nbsp; &nbsp; print(String1)</div>
}</font><font color="black" size="2" face="arial" style="color: black; font-family: arial, helvetica; font-size: 10pt;">&nbsp;</font></div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"><font color="black" size="2" face="arial" style="color: black; font-family: arial, helvetica; font-size: 10pt;"><br>
</font></div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"><font color="black" size="2" face="arial" style="color: black; font-family: arial, helvetica; font-size: 10pt;">But get error from compiler&nbsp;<br>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">/home/roman/swift/Sources/main.swift:11:19: error: 'init' has been renamed to 'init(describing:)'</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&nbsp; &nbsp; let String1 = String(databuffer, encoding: String.Encoding.utf8)</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">Swift.String:21:12: note: 'init' has been explicitly marked unavailable here</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&nbsp; &nbsp; public init&lt;T&gt;(_: T)</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">&lt;unknown&gt;:0: error: build had 1 command failures</div>

<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040">error: exit(1): /home/roman/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/swift-build-tool -f /home/roman/swift/.build/debug.yaml</div>

<div><br>
<br>
Why it talking about init? when i use String</div>

<br>



<div style="clear:both">Roman Pastushkov<br>

xnucleargeminix@aol.com<br>

</div>

</font>
</div>

</div>
</font>