Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7863977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:39:02+00:00 2026-06-02T23:39:02+00:00

import System.Directory import qualified Data.ByteString as BS import qualified Data.ByteString.UTF8 as BS_UTF8 main =

  • 0
import System.Directory
import qualified Data.ByteString as BS  
import qualified Data.ByteString.UTF8 as BS_UTF8

main = do
    putStrLn "Input path to some file: "
    raw_inputed_path <- BS.getLine
    let inputed_path = BS_UTF8.toString raw_inputed_path
    such_file_exists <- doesFileExist inputed_path
    such_directory_exists <- doesDirectoryExist inputed_path
    if such_file_exists 
        then putStrLn "Yeah, I see it!"
        else if such_directory_exists
            then putStrLn "Aha, I see it, but it's a directory!"
            else putStrLn "Hmm... No such..."

This code perfectly works with ASCII-paths only. But if I use paths with non-ASCII symbols, doesFileExist and doesDirectoryExist always return False. Why?

  • Debian GNU/Linux 6.0 x86_64
  • ghc 6.12.1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:39:04+00:00Added an answer on June 2, 2026 at 11:39 pm

    Upgrade to GHC 7.x series – 6.12 is now nearly 3 years out of date. The behavior was fixed around a year ago.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my code for counting lines and words: import System.IO import Data.List main
here is my code:(get file line num and word count) import System.IO import Data.Maybe
Im trying push some data into a CRM system via an XML import. I
Alright so here's my current code: import System.IO import System.Environment import System.Directory main =
$importkey = system('gpg --import newkey.asc . $username'); need to pass the file name as
I've seen some code such as: out.println(print something); I tried import java.lang.System; but it's
import java.lang.Math; public class NewtonIteration { public static void main(String[] args) { System.out.print(rootNofX(2,9)); }
.aspx file: <%@ Import Namespace=System.IO %> <html xmlns=http://www.w3.org/1999/xhtml> <head id=Head1 runat=server> <title>Explorer</title> </head> <body>
I have written the following IronPython code: import clr clr.AddReference(System.Drawing) from System import *
import sys, os X = os.system(ipconfig) print X 0 I know its simple, I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.