Python How to Check if File can be Read or Written

Collection of Checks for Readable and Writable Files.

“Education is the most powerful weapon which you can use to change the world.” ― Nelson Mandela

1. Introduction

It can be a bit cumbersome at times to check for read or write permission on a file. The check might succeed but the actual operation could fail. Also, quite a few edge cases need to be covered to get a reasonable answer from such a check. In this article, we cover some issues with regards to checking read and write permission on a file.

Continue reading “Python How to Check if File can be Read or Written”

How to Check Whether a File Exists in Python?

A review of various methods in python to check for file existence.

“Knowledge is a treasure, but practice is the key to it.” ― Lao Tzu

1. Introduction

Python offers several alternative ways of checking whether a file exists. Each of these ways come with several quirks. Examine each and pick the one that suits you.

Continue reading “How to Check Whether a File Exists in Python?”

Java – Zip Folder Tutorial

Learn how to zip a folder in Java

“Quotation, n: The act of repeating erroneously the words of another.”
― Ambrose Bierce, The Unabridged Devil’s Dictionary

1. Introduction

Java provides good support for reading and writing zip files. In this article, let us learn how to create a zip file from the contents of a folder in java.

Continue reading “Java – Zip Folder Tutorial”

Java Path API Tutorial

Learn the intricacies of using the Java Path API in this tutorial

“The mind is not a vessel to be filled, but a fire to be kindled.”
― Plutarch

1. Introduction

The Java Path API is a new introduction starting from version 1.7. It provides convenience methods for manipulating file paths in a system-independent way. Let us examine the usage of the Path API in more detail.

Continue reading “Java Path API Tutorial”