<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"> 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"> let databuffer = file?.readDataToEndOfFile</div>
<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"> let String1 = String(databuffer, encoding: String.Encoding.utf8)</div>
<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"> file?.closeFile()</div>
<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"> print(String1)</div>
}</font><font color="black" size="2" face="arial" style="color: black; font-family: arial, helvetica; font-size: 10pt;"> </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 <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"> let String1 = String(databuffer, encoding: String.Encoding.utf8)</div>
<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"> ^</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"> public init<T>(_: T)</div>
<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"> ^</div>
<div id="AOLMsgPart_2_d8ab15aa-f2bf-4caf-bdbc-0be0f5d39040"><unknown>: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>