summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--how_to_archive_with_posix_tar_cpio_and_pax.html8
-rw-r--r--how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory-1.png (renamed from design_simple_interfaces_how_to_store_files_in_arbitrary_memory-1.png)bin1957 -> 1957 bytes
-rw-r--r--how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory-2.png (renamed from design_simple_interfaces_how_to_store_files_in_arbitrary_memory-2.png)bin2919 -> 2919 bytes
-rw-r--r--how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory.html (renamed from design_simple_interfaces_how_to_store_files_in_arbitrary_memory.html)30
-rw-r--r--index.html7
5 files changed, 28 insertions, 17 deletions
diff --git a/how_to_archive_with_posix_tar_cpio_and_pax.html b/how_to_archive_with_posix_tar_cpio_and_pax.html
index 28c3878..09d1512 100644
--- a/how_to_archive_with_posix_tar_cpio_and_pax.html
+++ b/how_to_archive_with_posix_tar_cpio_and_pax.html
@@ -30,7 +30,7 @@ the exact same order, with tar being at 8th place overall, cpio at 52nd, and pax
least popular one, so I'll explain shortly how to use each of them in your usual Linux distribution while keeping in
mind what POSIX had to tell us back in the day.
-<h2>tar</h2>
+<h2>How to Archive With POSIX tar utility</h2>
<p>Like I've already mentioned tarballs are the most popular. Not only that, they are commonly described as the easiest
to use, although the interface is something that you can find jokes about. All operations on tarballs are handled via
single tar utility.</p>
@@ -52,7 +52,7 @@ $ tar cf ../archive.tar a_file a_directory
include in the archive)
<dt><code>a_file a_directory</code><dd>Files to include in the archives
</dl>
-<p>Now that you have an archive, you can see it's content:</p>
+<p>Now that you have an archive, you can see its content:</p>
<pre>
$ tar tf ../archive.tar
a_file
@@ -77,7 +77,7 @@ default behaviour if no archive file is provided at all.
and <code>u</code> that first tries to update the file in archive if it exists and if it doesn't then it adds it. Note,
that the usual compression options are not available in POSIX, they are an extension.
-<h2>cpio</h2>
+<h2>How To Archive With POSIX cpio utility</h2>
<p>Heading off from the usual routes we encounter cpio. It's a more frequent sight than pax, but it still is quite niche
compared to tar's omnipresence. Frankly, I like this one the most because of the way it handles input of file lists.
Sadly, this also makes it slightly bothersome to use.
@@ -140,7 +140,7 @@ $ ls ../destination
a_directory a_file
</pre>
-<h2>pax</h2>
+<h2>How to Archive With POSIX pax utility</h2>
<p>Finally, at the destination! This one lives up to the name of this post as it's still part of POSIX. The fun part is
that you probably don't even have it installed, but don't worry, I didn't have it until like two days ago. It truly
feels like a compromise forced on you and your siblings by your parents. Jokes aside, I actually started to like it,
diff --git a/design_simple_interfaces_how_to_store_files_in_arbitrary_memory-1.png b/how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory-1.png
index 4f7f4b0..4f7f4b0 100644
--- a/design_simple_interfaces_how_to_store_files_in_arbitrary_memory-1.png
+++ b/how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory-1.png
Binary files differ
diff --git a/design_simple_interfaces_how_to_store_files_in_arbitrary_memory-2.png b/how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory-2.png
index 51608f5..51608f5 100644
--- a/design_simple_interfaces_how_to_store_files_in_arbitrary_memory-2.png
+++ b/how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory-2.png
Binary files differ
diff --git a/design_simple_interfaces_how_to_store_files_in_arbitrary_memory.html b/how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory.html
index 1651cde..616bf9a 100644
--- a/design_simple_interfaces_how_to_store_files_in_arbitrary_memory.html
+++ b/how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory.html
@@ -7,20 +7,20 @@
<link rel="icon" type="image/png" href="cylo.png">
<link rel="stylesheet" href="style.css">
-<title>Design Simple Interfaces: How to Store Files in Arbitrary Memory</title>
+<title>How to Create Generic Interfaces by Example of Storing Files in Arbitrary Memory</title>
<nav><p><a href="https://ignore.pl">ignore.pl</a></p></nav>
<article>
-<h1>Design Simple Interfaces:<br>How to Store Files in Arbitrary Memory</h1>
-<p class="subtitle">Published on 2022-01-25 23:45:00+01:00
+<h1>How to Create Generic Interfaces by Example of Storing Files in Arbitrary Memory</h1>
+<p class="subtitle">Published on 2022-01-25 23:45:00+01:00, last modified on 2022-01-26 18:44:00+01:00
<p>This one comes as a little surprising and for experienced (or even intermediate) reader may appear boring. Think of
it as "back to the fundamentals" type of article. Now that I think about it... Do I even have anything that wouldn't
classify into this category? Oh, yeah, rants.</p>
-<img src="design_simple_interfaces_how_to_store_files_in_arbitrary_memory-1.png" alt="bird">
-<p>I had an opportunity to give some lecture over at the local university about programming and one of the topics was
-loosely related to persistence. We were playing around with a <a href="https://git.ignore.pl/hwd/hwd/">hardware
-simulator</a> and I asked a question that we could use as a plot device:
+<img src="how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory-1.png" alt="bird">
+<p>I had an opportunity to give lectures at the local university about programming and one of the topics was loosely
+related to persistence. We were playing around with a <a href="https://git.ignore.pl/hwd/hwd/">hardware simulator</a>
+and I asked a question that we could use as a plot device:
<p><strong>What is the simplest way to put several files into an arbitrary memory?</strong>
<p>Now, that probably wouldn't be a blog post if it wasn't for that not only the students were surprised, but also my
colleagues at work.
@@ -65,7 +65,7 @@ knowledge would be enough for the program to write and read arbitrary strings as
<p>Since we are using strings as an example, there is also another implementation of them: length coupled with an array.
This kind of format allows the string to contain null bytes which is convenient when storing sightly more arbitrary
data.</p>
-<img src="design_simple_interfaces_how_to_store_files_in_arbitrary_memory-2.png" alt="i/o">
+<img src="how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory-2.png" alt="i/o">
<p>Assume that you know the size of the memory - in case of this simulator it's 10KB - figure out the number of bytes
you need to use to store the maximum length of the data (2 bytes here), and then just say that there is an integer on
first X bytes of that memory. Write the length of data to these bytes when writing data. Read the length of data from it
@@ -119,11 +119,19 @@ $ ./our_memory_write filesystem.img
</pre>
<p>Quite satisfying, but that's not the point of this post.
<h2>Design Simple Interfaces</h2>
+<p>Now, technically speaking this whole example can be limiting in couple of aspects. Primary thing you may not like
+about it is that it focuses on shell usage, and for some it's an outdated approach. One way to solve it would be to
+follow Hurd way and implement the interface as filesystem in userspace.
+<p>However, technicalities weren't meant to be the primary topic, it just so happened because they were fun to write
+about. What I would want you to understand by this example is that designing interfaces, following conventions or
+standards and choosing points/levels of contacts are all important things. You may think that when you just build
+single program it doesn't matter, but in such cases it matters even more, because if it happens to be used in long term,
+sooner or later it will be integrated with other programs.
<p>This isn't about UNIX philosophy. This isn't about standardization of the entire world. No. It's all about you, your
creations, and things that you integrate with. And it's sounds all hippie-dippie-unicorns, but that's just how it is.
Think about what you are building. Think about what you will need and what you will integrate with. Find common generic
-interfaces that will last and build upon them. This method of saving files into memory works because it builds on a
-well-established and incredibly simple convention. Look at the all-popular Web APIs, they built on top of HTTP so well
-that it's hard to believe that there are any other protocols out there in the net.
+interfaces that will last and build upon them. Be conscious about it. This method of saving files into memory works only
+because it builds on a well-established and incredibly simple convention. Look at the all-popular modern Web APIs, they
+are built on top of HTTP so well that it's hard to believe that there are any other protocols out there in the net.
</article>
<script src="https://stats.ignore.pl/track.js"></script>
diff --git a/index.html b/index.html
index dbe28ef..6ac0fd0 100644
--- a/index.html
+++ b/index.html
@@ -32,8 +32,11 @@
<section id="blog">
<h2>Blog</h2>
<ul>
-<li> <a href="design_simple_interfaces_how_to_store_files_in_arbitrary_memory.html">Design Simple Interfaces: How to
- Store Files in Arbitrary Memory</a><br>
+<li> Renamed article from yesterday and fixed some typos around the place.<br>
+ Updated POSIX tar, cpio and pax guide with better headers.<br>
+ <time>2022-01-26</time>
+<li> <a href="how_to_create_generic_interfaces_by_example_of_storing_files_in_arbitrary_memory.html">How to Create
+ Generic Interfaces by Example of Storing Files in Arbitrary Memory</a><br>
<time>2022-01-25</time>
<li> Once again I'm breaking this place apart. For now I separated main index from the blog and reverted back to
date-based indexing for the blog. I don't quite like the looks of it just yet, so consider this an ongoing