aboutsummaryrefslogtreecommitdiff
path: root/store/works/life/operating-system-course-design/create-file.bash
diff options
context:
space:
mode:
Diffstat (limited to 'store/works/life/operating-system-course-design/create-file.bash')
-rw-r--r--store/works/life/operating-system-course-design/create-file.bash29
1 files changed, 29 insertions, 0 deletions
diff --git a/store/works/life/operating-system-course-design/create-file.bash b/store/works/life/operating-system-course-design/create-file.bash
new file mode 100644
index 0000000..4aa98b8
--- /dev/null
+++ b/store/works/life/operating-system-course-design/create-file.bash
@@ -0,0 +1,29 @@
+
+let dir_count=256
+let file_count=500;
+
+for dir_iter in `seq $dir_count`; do
+ mkdir -p /mnt/fat-test/$dir_iter
+ for iter in `seq $file_count`; do
+ truncate -s 4KB /mnt/fat-test/$dir_iter/$iter;
+ done
+ echo "Created 500 files in dir $dir_iter";
+done
+
+df
+
+for dir_iter in `seq $dir_count`; do
+ mkdir -p /mnt/fat-test/$dir_iter
+ for iter in `seq $file_count`; do
+ if (($iter % 2 == 0)); then
+ rm /mnt/fat-test/$dir_iter/$iter;
+ fi
+ done
+ echo "Deleted 250 files in dir $dir_iter";
+done
+
+df
+
+truncate -s 200MB /mnt/fat-test/big;
+
+df