Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling nlst or dir function on FTPConnection causes the program to silently exit #9

Open
souravdatta opened this issue Mar 2, 2015 · 2 comments

Comments

@souravdatta
Copy link

I am not entirely sure whether this issue is with the library or the Windows 7 64bit system I am using. I am new to Haskell and was trying to write a rudimentary ftp app for my own use. The test case is:

module FtpTest
        where

import Network.FTP.Client
import Network.FTP.Client.Parser

display :: Maybe String -> IO ()
display (Just path) = putStrLn path
display Nothing = putStrLn "No path!"

ftpTest :: String -> String -> String -> IO Network.FTP.Client.Parser.FTPResult
ftpTest host usr pass = do
    enableFTPDebugging
    h <- easyConnectFTP host
    login h usr (Just pass) Nothing
    (pwd, _) <- pwd h
    display pwd
    putStrLn "Going to list dir"
    fs <- dir h Nothing
    putStrLn "Done"
    quit h

When running the ftpTest function, I get the current directory and "Going to list dir" printed. But then the program exits silently. I have also tried nlst function but the behaviour is same.

The log below shows output with enableFTPDebugging.

*FtpTest> ftpTest "" "" "" Loading package array-0.5.0.0 ... linking ... done. Loading package deepseq-1.3.0.2 ... linking ... done. Loading package bytestring-0.10.4.0 ... linking ... done. Loading package Win32-2.3.0.2 ... linking ... done. Loading package transformers-0.3.0.0 ... linking ... done. Loading package old-locale-1.0.0.6 ... linking ... done. Loading package time-1.4.2 ... linking ... done. Loading package containers-0.5.5.1 ... linking ... done. Loading package mtl-2.1.3.1 ... linking ... done. Loading package regex-base-0.93.2 ... linking ... done. Loading package regex-posix-0.95.2 ... linking ... : warning: isal um from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isupper from msvcrt is linked instead of __imp_isupper : warning: toupper from msvcrt is linked instead of __imp_toupper : warning: tolower from msvcrt is linked instead of __imp_tolower : warning: isalpha from msvcrt is linked instead of __imp_isalpha : warning: isalpha from msvcrt is linked instead of __imp_isalpha : warning: isalpha from msvcrt is linked instead of __imp_isalpha : warning: iscntrl from msvcrt is linked instead of __imp_iscntrl : warning: isupper from msvcrt is linked instead of __imp_isupper : warning: isgraph from msvcrt is linked instead of __imp_isgraph : warning: isprint from msvcrt is linked instead of __imp_isprint : warning: ispunct from msvcrt is linked instead of __imp_ispunct : warning: isalnum from msvcrt is linked instead of __imp_isalnum : warning: isalpha from msvcrt is linked instead of __imp_isalpha done. Loading package regex-compat-0.95.1 ... linking ... done. Loading package text-1.1.0.0 ... linking ... done. Loading package parsec-3.1.5 ... linking ... done. Loading package old-time-1.1.0.2 ... linking ... done. Loading package network-2.4.2.3 ... linking ... : warning: inet_nt a from ws2_32 is linked instead of __imp_inet_ntoa : warning: getnameinfo from ws2_32 is linked instead of __imp_getn meinfo : warning: getaddrinfo from ws2_32 is linked instead of __imp_geta drinfo : warning: freeaddrinfo from ws2_32 is linked instead of __imp_fre addrinfo : warning: accept from ws2_32 is linked instead of __imp_accept : warning: WSACleanup from ws2_32 is linked instead of __imp_WSACl anup : warning: WSAStartup from ws2_32 is linked instead of __imp_WSASt rtup : warning: WSACleanup from ws2_32 is linked instead of __imp_WSACl anup done. Loading package filepath-1.3.0.2 ... linking ... done. Loading package directory-1.2.1.0 ... linking ... done. Loading package HUnit-1.2.5.2 ... linking ... done. Loading package process-1.2.0.0 ... linking ... done. Loading package hslogger-1.2.8 ... linking ... done. Loading package random-1.0.1.1 ... linking ... done. Loading package MissingH-1.3.0.1 ... linking ... done. Loading package ftphs-1.0.9.1 ... linking ... done. FTP received: 220 (vsFTPd 2.0.5) FTP sent: USER FTP received: 331 Please specify the password. FTP sent: PASS FTP received: 230 Login successful. FTP sent: PWD FTP received: 257 "/home/uname" /home/uname Going to list dir FTP sent: TYPE A FTP received: 200 Switching to ASCII mode. FTP sent: PASV FTP received: 227 Entering Passive Mode (10,240,106,18,41,229) <-- exits here

System information:

OS - Windows 7 64 bit
Haskell - Fresh installation of Haskell platform downloaded from the distribution site.
ftphs - installed using Cabal.

@souravdatta
Copy link
Author

Also, I have tested this on a Mac and Ubuntu box, connecting to the same FTP server and that worked, so the problem is Windows specific.

@wochinge
Copy link

wochinge commented May 8, 2015

I have the same issue. Apparently the libs are not usable for windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants