ali980 0 Posted June 14, 2012 Dears, I am trying to download a file from Solaris server to my windows PC by using the command: _FTP_FileGet($Conn, $filenameget, $filenameget, $INTERNET_FLAG_TRANSFER_ASCII) _FTP_FileGet($Conn, $filenameget, $filenameget, "11") In both command the file that is downloaded is in ascii, but in Unix EOL conversion. (End Of Line Conversion). My question is how can I get is as Windows EOL conversion? Regards, Ali Share this post Link to post Share on other sites
BrewManNH 1,304 Posted June 14, 2012 I would try using FileReadToArray, and then _FileWriteFromArray and see if that fixes the problem. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Share this post Link to post Share on other sites
ali980 0 Posted June 14, 2012 Thanks for the hint, but I am using another workaround which is working perfectly. See below: $ali = Run ("cmd") $windowname = 'C:\Windows\system32\cmd.exe' WinWait ($windowname) WinActivate ($windowname) send('cd ' & @ScriptDir & '{enter}') send('ftp ' & $server & '{enter}') send($username & '{enter}') Send ($pass & '{enter}') Send ('cd ' & $workingdir &'{enter}') Send ('Ascii{enter}') send ('get ' & $filenameget & '{enter}') send ('quit{enter}') send ('exit{enter}') WinWaitClose ($windowname) Share this post Link to post Share on other sites
Mechaflash 99 Posted June 14, 2012 gg... manipulating a CMD gui... Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Share this post Link to post Share on other sites
ali980 0 Posted June 27, 2013 I got a way how to do it: $Open = _FTP_Open('MyFTP') $Conn = _FTP_Connect($Open, $server, $uname, $pass) $FileSize = _FTP_FileGetSize($Conn, $workingdir & $file_name) $hfileO = _FTP_FileOpen($Conn, $workingdir & $file_name, $GENERIC_READ, $FTP_TRANSFER_TYPE_ASCII) $result = _FTP_FileRead($hfileO, $FileSize) $hfileC = _FTP_FileClose($hfileO) $file = FileOpen($file_name, 2) ;2 = Write mode (erase previous contents) FileWriteLine($file, BinaryToString($result)) FileClose($file) $Ftpc = _FTP_Close($Open) Share this post Link to post Share on other sites
BrewManNH 1,304 Posted June 27, 2013 Took you a year to come up with that? And what exactly does that script do that fixes the EOL characters? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Share this post Link to post Share on other sites