This repository was archived by the owner on Oct 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Added blog post for Jack Sauriol #57
Open
sauriol
wants to merge
1
commit into
ComputerScienceHouse:master
Choose a base branch
from
sauriol:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| --- | ||
| layout: post | ||
| title: System Information with Rust | ||
| date: 2018-04-10 | ||
| categories: | ||
| - projects | ||
| description: A Rust library that returns information about the local system it's running on. | ||
| author: Jack Sauriol | ||
| author-image: https://avatars0.githubusercontent.com/u/11964990?s=400&u=9130317fb4317fd97f55b3531497d491dc561dca&v=4 | ||
| author-bio: First year member of Computer Science House, Computing Security student at RIT | ||
| author-email: saurioljohn@gmail.com | ||
| author-social: | ||
| github: https://github.com/sauriol | ||
| linkedin: https://www.linkedin.com/in/john-sauriol-a4155514a/ | ||
| --- | ||
|
|
||
| # Description # | ||
| System Information is a library written in Rust that returns certain information about your local system. | ||
| It supports various Linux distros, Mac OS, and Windows. | ||
| Currently, it can get information about the current user, the hostname, the operating system, the disk, memory, and the CPU. | ||
| Additionally, it can present the disk and memory information in raw number of bytes or a human readable format. | ||
|
|
||
|
|
||
| # Specifics # | ||
| System Information uses Rust's conditional compilation feature, so it compiles different versions of functions and their helper functions depending on the operating system it's running on. | ||
| This allowed me to compile the library with different dependencies and other libraries depending on the operating system. | ||
|
|
||
|
|
||
| ## Linux ## | ||
| I decided to create this library because I was unhappy with what I had found with other similar libraries. | ||
| All that I found used commands that didn't exist on my system, so I decided to try to make one avoiding commands that didn't necessarily exist. | ||
| System Information either uses commands that are part of the coreutils package or reads from a file to get information. | ||
|
|
||
|
|
||
| ## Mac OS ## | ||
| Mac OS is far more consistent than Linux so I felt a little more free to use commands to get information. | ||
| Specifically, the `sysctl` command is used to get hardware information. | ||
|
|
||
|
|
||
| ## Windows ## | ||
| Windows was far more difficult than Mac OS and Linux. | ||
| Luckily, windows.h is an excellent Windows-specific header file for C and C++, so anything I couldn't do in Rust I was able to do by writing a C++ program that would output the desired information and then capturing that output in Rust. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add an image attribute w/ a screenshot of the project? Should be in the form:
image: https://urlgoes.here/