Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having a strange problem in Linux that I don't understand fully owing to my limited knowledge. I sure hope someone here will be able to clear things up!
I have a setup wherein I login to a Linux server and run a program from the command prompt. The program opens a video file present in the same directory and sends it to a given port on a given IP address. While the file is being sent, I open another terminal; login to the same Linux server and delete the file being sent.
On doing an 'ls', I don't see the file; but the file continues to be sent successfully in the first terminal.
Could someone explain how this is possible?
Adding on to the question raised in the previous post...
I tried the same experiment as before, but this time logging into a different Linux server.
In this case, after I have deleted the file being sent; I see that my program running in the first terminal can no longer send the file (throws up an error).
The only thing that seems to be different between the 2 Linux servers is the file system:
1st expt, filesystem = yaffs2
2nd expt, filesystem = mvfs
Do you think this makes a difference? Do different filesystems handle file delete differently?
Could you please point me to some links where I can gather more information.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Under Unix, deleting a file is really just unlinking its content (inode) from one of its directory entries (filename).
As long as at least one directory entry is pointing to the data, the file content is available.
As long as a file descriptor is still open on the file, the data should still be available.
The data is really freed only after all the processes keeping the file open eventually close it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.