Code Monkey home page Code Monkey logo

disk-free-space's People

Contributors

redneb avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

disk-free-space's Issues

RawFilePath support

I am moving my program to using RawFilePath (ByteString), but before using this library I have to convert back to FilePath. That is somewhat slow and complicated. It would be great to have a System.DiskSpace.ByteString (following the namespace that the unix package uses for RawFilePath modules).

Implementation should be simple, System.Posix.ByteString.FilePath.withFilePath produces a CString, and getDiskUsage just needs to have the part that uses CString split out to a helper function.

RawFilePath does not make sense on Windows, so the System.DiskSpace.ByteString module could be only made available on unix.

If this is an acceptable plan, I'll implement it.

Lower minimum base

I was using an old ghc 7.4.1 which released with Debian Wheezy. I wasn't able to depend on this package as is, because its minimum requirement in the cabal file for base is 4.6.

The package built fine for me when I lowered the requirement to 4.5, and I wonder if you might upload a version with the lowered requirement?

safe vs. unsafe FFI calls

The import of statvfs is:

foreign import ccall unsafe statvfs :: CString -> Ptr a -> IO CInt

Since this function is doing a system call, I'm not sure why it is marked as unsafe - in case of remote filesystems, this could block for a long time (in real world terms). What do you think about making this safe, since the overhead of the syscall will anyway make the Haskell RTS overhead most likely moot?

portability documentation

It would be good to mention just which OS's this is known to work on. The need for 64 bit values for modern disk sizes may be a complication for some OS's too, so it's probably worth a mention.

I've been maintaining similar portable code in git-annex, so I compared the two.

The OS's I'm confident disk-free-space works on, after testing: Linux, OSX, Windows, Debian kFreeBSD. Probably regular FreeBSD, but I don't know for sure. OpenBSD: Don't know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.