[Finish ch21 changes John Goerzen **20080708075258] { hunk ./en/ch21-systems.xml 95 + + Is the filter (`notElem` [".", ".."]) part + confusing? That could got also be written as filter + (\c -> not $ elem c [".", ".."]). The backticks in + this case effectively let us pass the second argument to + notElem; see for + more information on backticks. + hunk ./en/ch21-systems.xml 149 - the traditional POSIX epoch. A &ClockTime; represents the number of - seconds since midnight the morning of January 1, 1970, UTC. A - negative &ClockTime; represents times prior to that date, while a - positive number represents times after it. + the traditional POSIX epoch. A &ClockTime; represents a time + relative to midnight the morning of January 1, 1970, UTC. A + negative &ClockTime; represents a number of seconds prior to that date, while a + positive number represents a count of seconds after it. hunk ./en/ch21-systems.xml 164 - manner of handling leap seconds is system-dependant and complex, + manner of handling leap seconds is system-dependent and complex, hunk ./en/ch21-systems.xml 171 - elapsed. You can then divide by 24 and display the elapsed time as a + elapsed. You can then divide by 3600 and display the elapsed time as a hunk ./en/ch21-systems.xml 191 - What will be the time on this date next - month? hunk ./en/ch21-systems.xml 240 - time 1500 seconds after midnight on January 1, 1970, UTC. + time 1000 seconds after midnight on January 1, 1970, UTC. + That moment in time is known as the epoch. hunk ./en/ch21-systems.xml 457 - + + The functions such as accessTime return + data in a POSIX-specific type called + EpochTime, which se convert to a + &ClockTime; using the toct function. hunk ./en/ch21-systems.xml 470 - - Invoking External Commands - - The System.Cmd module provides a cross-platform way - to invoke external commands. This could let you call system utilities - or - start up programs to gather data from the user. The functions in - System.Cmd pause execution of your Haskell program - while the new program runs, then continue where it left off after the - called program terminates. - - - The most useful if the functions in System.Cmd is - rawSystem. It takes an executble name and a list of - command-line arguments to pass to it, and returns an exit code. You - can even test it from &ghci; like this: - - &cmd.ghci:all; - - rawSystem does not pass the command or its arguments - through the shell. This is an important safety and integrity feature. - The shell may perform wildcard expansion, argument parsing, and other - tasks on the input. This can lead to problems or even security risks - when dealing with things as simple as filenames containing spaces or - strings containing punctuation. For this reason, we recommend using - rawSystem instead of alternatives such as - system at all times. - - - hunk ./en/ch21-systems.xml 546 - rawSystem because this would mess up the stdandard + rawSystem because this would mess up the standard hunk ./examples/ch21/dir.ghci 10 -getDirectoryContents "/" >>= return . filter (\c -> not $ elem c [".", ".."]) +getDirectoryContents "/" >>= return . filter (`notElem` [".", ".."]) }