Skip to content

danielgrigg/city_weather_fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CityWeather FS

FUSE for the weather of cities across the globe.

Demonstrates the simplicity of creating a virtual filesystem using FUSE and hopefully inspires people to 'FUSE all the things!'.

Checkout the associated blog post at CityFS.

Build Status

Installing

MacOS

MacOS You'll need an updated FUSE installation which you can get here OSXFuse.

Linux

sudo apt-get install libcurl4-openssl-dev libfuse-dev

Windows

Unfortunately FUSE support is lacking. There's some OSS efforts but you'll probably want to look at either writing your own Mini driver or a commercial solution like CBFS.

Build the driver

$ mkdir build; cd build
$ cmake ..
$ make

Usage

I've supplied ./cities15k.csv which includes the most populous 15K cities to populate the VFS.

Like most FUSE drivers you'll run cityfs which in turn mounts the VFS to a given mount-point. Once the mount is complete, you can access the file system there.

$ ./build/cityfs [city-file] [mount-point]

city-file must be a csv of (country-code,city,lat,lng,elevation,region)

For example: $ cityfs cities15k.csv ~/cities

Where cities15k.csv looks like:

  AU,Gold Coast,-28.00029,153.43088,591473,Australia/Brisbane
  AU,Gladstone,-23.84761,151.25635,30489,Australia/Brisbane
  AU,Geelong,-38.14711,144.36069,226034,Australia/Melbourne

mount-point must exist before launch

Once it's running, take try reading the file-tree under your mount-point.

Code Layout

All the code is standard C++11. CMake is used for builds. There's no tests cause this is a POC ;)

  • driver.cpp - FUSE related code
  • cityfs.x - model the city FS
  • cityfs_weather.x - OpenWeatherMap reader
  • country_codes - precomputed country code -> country names
  • cityfs_util - utility methods

Acknowledgements

Copyright(c) 2014 Daniel C Grigg

About

Weather for 15k+ cities via FUSE

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published