8000 cdisk by malmers · Pull Request #3 · malmers/cdisk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cdisk #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# editorconfig.org
root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
*\.swp
.o

ramdisk
cdisk

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
CC = gcc
CFLAGS = -Wall
TARGET = ramdisk
TARGET = cdisk
DESTDIR = /usr/local/bin

all: $(TARGET).c
$(CC) $(CFLAGS) -o $(TARGET) $(TARGET).c

clean:
$(RM) $(TARGET)

install:
cp $(TARGET) $(DESTDIR)/$(TARGET)
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Ramdisk
# cdisk
A small program for creating ram disks in OS X written in c.

## Usage
ramdisk X
cdisk X

where X is the size of the ram disk to be created in Gigabytes.
To create a ram disk with a size of 2GB, enter:

ramdisk 2
cdisk 2

## Development
### Software requirements
Expand All @@ -16,5 +16,7 @@ To create a ram disk with a size of 2GB, enter:

Both dependencies are command line utilities that comes preinstalled with OS X.

## Build
## Build and Install
make
make install

5 changes: 1 addition & 4 deletions ramdisk.c → cdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
#include <string.h>
#include <ctype.h>
#include <getopt.h>

#define GIGABYTE 2097152
#define PATH_SIZE 100
#define VERSION "0.1"
#include "cdisk.h"

char* helptext = "Usage: ramdisk [options...] <size>\n"
"Options:\n"
Expand Down
3 changes: 3 additions & 0 deletions cdisk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define GIGABYTE 1024 * 2048
#define PATH_SIZE 100
#define VERSION "0.2"
0