Skip to content

Tag: file

How to open files sequentially on a terminal?

I want to iterate through all files in a directory and open them with an editor, but I don’t want to open the next one until the previous has closed. something like: Answer You don’t have to do anything; the shell blocks until vim exits each time through.

Clone a folder / raid on a folder?

I have two hard drive of 4Tb connected to my raspberry pi. Let’s call them A and B. I have some folders on A that have to be copied on B. At all the time, something like a RAID10 on some folder. So, if I copy test.jpg in disk A, test.jpg has to be copied on disk B. If I

fopen() returns inavlid argument when writing on SD card?

I’m trying to write a file on SD card if it’s inserted into the kit. Otherwise, the file should be written to the current directory of the project. I can write the file in the project’s directory without any problems. However, when I try to write it on the inserted SD card, it returns Invali…

How to create a system-wide file lock?

I am trying to have a number of independent processes coordinate their writing to file using a system-wide lock (see here: Concurrent file accesses from different scripts python) The lock needs to span the whole system, because the processes are spawn independently and at different times. Here: System-wide mu…