Skip to content
Advertisement

Tag: file

How Python reads a file when it was deleted after being opened

I’m having difficulties in understanding the concept of how Python reads a file when it was deleted after being open’ed. Here is the code: Text and binary modes give the same result. I tried this also for big files with more than 1Gb size and they were also read after being deleted. The operation of open happens almost instantaneously even

what is “.filename” in the linux and how to open that file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question

Compare columns from two files and print not match

I want to compare the first 4 columns of file1 and file2. I want to print all lines from file1 + the lines from file2 that are not in file1. I don’t understand how to print things that don’t match. Answer You can do it with an awk script like this: script.awk And run it like this: awk -f script.awk

Why can’t bash recognize the existence of a socket file

On a Linux box I want to check if a specific socket file exists. I know the socket files exists, but my checks in bash don’t show that to me: Why oh why can’t bash see that the file exists? Answer http://www.tldp.org/LDP/abs/html/fto.html Use -S to test if its a socket. -f is for regular files. See man 1 test:

Organize file by Linux

I want to thank the great help and support. Well, I have the following file: and I need that file be this way: Please, someone can help me? Thank you very much Answer awk to the rescue!

linux get specific fields from several files

I have several files starting with the string “file” then a number (file1, file2, etc). The content of these files is similar and looks like this For each file, I want only keep the index of the element and the 2 numeric fields just after coordinates (in the same file or in another file): file1: What I tried to do

linux kernel: is vfs_write thread safe?

In my program, I need to write file in kernel space due to some special reason although I know it’s not recommended. I’m using vfs_write to write files in kernel space and it works fine. In one case, there are two threads need to write to the same file. From the internet, it seems that user-space write is thread safe,

link count and ls command

I’m learning file link count. Only when link count reaches 0 can file’s contents be deleted. In my test the process opens a file in directory “/home/hel/myfile” and sleep 10(s). At the same time I delete it using “rm /home/hel/myfile”. Then I use command “ls” and display No such file. But in fact, the file still exists because the fd

Advertisement