<commit_before>{-# OPTIONS -cpp #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Compat.RawSystem
-- Copyright   :  (c) The University of Glasgow 2001-2004
-- License     :  BSD-style (see the file libraries/base/LICENSE)
-- 
-- Maintainer  :  <EMAIL>
-- Stability   :  provisional
-- Portability :  portable
--
-- This is an implementation of rawSystem for use on older versions of GHC
-- which had missing or buggy implementations of this function.
--
-----------------------------------------------------------------------------

module Compat.RawSystem (rawSystem) where

#if __GLASGOW_HASKELL__ >= 603

import System.Cmd (rawSystem)

#else /* to end of file */

import System.Exit
import Foreign
import Foreign.C

{- | 
The computation @'rawSystem' cmd args@ runs the operating system command
whose file name is @cmd@, passing it the arguments @args@.  It
bypasses the shell, so that @cmd@ should see precisely the argument
strings @args@, with no funny escaping or shell meta-syntax expansion.
(Unix users will recognise this behaviour 
as @execvp@, and indeed that's how it's implemented.)
It will therefore behave more portably between operating systems than 'system'.

The return codes are the same as for 'system'.
-}

rawSystem :: FilePath -> [String] -> IO ExitCode

{- -------------------------------------------------------------------------<commit_msg>[project @ 2004-11-12 14:09:39 by simonpj] Windows fix (include config.h)<commit_after>{-# OPTIONS -cpp #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Compat.RawSystem
-- Copyright   :  (c) The University of Glasgow 2001-2004
-- License     :  BSD-style (see the file libraries/base/LICENSE)
-- 
-- Maintainer  :  <EMAIL>
-- Stability   :  provisional
-- Portability :  portable
--
-- This is an implementation of rawSystem for use on older versions of GHC
-- which had missing or buggy implementations of this function.
--
-----------------------------------------------------------------------------

module Compat.RawSystem (rawSystem) where

#if __GLASGOW_HASKELL__ < 603
#include "config.h"
#endif

#if __GLASGOW_HASKELL__ >= 603

import System.Cmd (rawSystem)

#else /* to end of file */

import System.Exit
import Foreign
import Foreign.C

{- | 
The computation @'rawSystem' cmd args@ runs the operating system command
whose file name is @cmd@, passing it the arguments @args@.  It
bypasses the shell, so that @cmd@ should see precisely the argument
strings @args@, with no funny escaping or shell meta-syntax expansion.
(Unix users will recognise this behaviour 
as @execvp@, and indeed that's how it's implemented.)
It will therefore behave more portably between operating systems than 'system'.

The return codes are the same as for 'system'.
-}

rawSystem :: FilePath -> [String] -> IO ExitCode

{- -------------------------------------------------------------------------
{'fraction_non_alphanumeric': 0.23717948717948717, 'fraction_numerical': 0.013157894736842105, 'mean_word_length': 1.9590818363273452, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5506017', 'n_tokens_mistral': 803, 'n_tokens_neox': 752, 'n_words': 310}