Snippets tagged io

  • 'use' Bindings

    Show's how to use F# 'use' key word to dispose a resource when it passes out of scope.

    33 people like this

    Posted: 13 years ago by Robert Pickering

  • Compute CC.Net build statistics

    Written against CruiseControl.NET v1.5. Queries a CruiseControl.NET server for a project list and then computes min, max, average, and standard deviation of the build durations based on the statistics.csv CC.NET maintains.

    3 people like this

    Posted: 12 years ago by Matt Wilson

  • Enumerate files without permissions errors

    It's comparatively hard to enumerate files in a directory and subdirectories without getting exceptions for items you don't have permission to read. Here's a function which just ignores items you can't read and enumerates everything else. Useful for searching big network shares.

    4 people like this

    Posted: 11 years ago by Kit Eason

  • Tree walker

    creates folder and file structure on the file system based on a tree output. Given a file generated from tree /f /a > file.txt it creates the structure on a given folder

    3 people like this

    Posted: 9 years ago by orlandow

  • Tiny IO Monad

    Haskell-style IO in F#.

    16 people like this

    Posted: 12 years ago by igeta

  • Poll a file until it is quiet

    One of the problems with using FileSystemWatcher to detect new files and process them is that it tells you when the file starts being created, not when it finishes. Use this little function to poll the file until it stops being written to.

    7 people like this

    Posted: 12 years ago by Kit Eason

  • Are Files Present In A Directory?

    A quick and dirty function to check to see if there are files present in a directory. Note this will return false if there are only subdirs in a directory.

    1 people like this

    Posted: 10 years ago by Onorio Catenacci

  • Expose 'stdin' as a sequence of ints with termination control.

    Some scenarios require the ability to read stdin as a sequence of character codes. The console in .Net does not behave the same as a file. The console also has limited buffering capacity (you can't paste a large string into the console for example - try it). Call this function with arg = [-1;13] and the sequence will end if either 'enter' is pressed at the console or EOF is reached with a file.

    0 people like this

    Posted: 7 years ago by Hugh Gleaves