LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 03-11-2008, 11:00 AM   #1
gthm159
LQ Newbie
 
Registered: Mar 2008
Location: Bangalore, INDIA
Posts: 4

Rep: Reputation: 3
Question File Delete Confusion


Hi All,

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?

Regards,
G
 
Old 03-11-2008, 11:06 AM   #2
gthm159
LQ Newbie
 
Registered: Mar 2008
Location: Bangalore, INDIA
Posts: 4

Original Poster
Rep: Reputation: 3
Post

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.

Thanks,
G
 
Old 03-11-2008, 11:26 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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.

mvfs behavior you observe looks broken to me.
 
1 members found this post helpful.
Old 03-12-2008, 09:47 AM   #4
arulkumar.c
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Rep: Reputation: 0
Just that could be due to the buffering done when you open that file for transfer and hence does not get affected when you delete that file.

~Arul.C
 
Old 03-12-2008, 10:48 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by arulkumar.c View Post
Just that could be due to the buffering done when you open that file for transfer and hence does not get affected when you delete that file.
That would make sense but this buffering theory is unnecessary.

POSIX compliant filesystems are required to persist the content of a file even after the file has been deleted in this situation.
 
Old 03-12-2008, 06:22 PM   #6
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
try it with EXT2 as that is about as generic as it is possable to get

ive never heard of yaffs2 or mvfs
though i guess that yaffs2 stands for "yet another fscking file system"
 
Old 03-18-2008, 06:41 AM   #7
gthm159
LQ Newbie
 
Registered: Mar 2008
Location: Bangalore, INDIA
Posts: 4

Original Poster
Rep: Reputation: 3
Thumbs up

Thanks for your replies "jlliagre" and others..
Sure helped to explain the behaviour.

For now, I'm going to proceed with the assumption that the mvfs behaviour is a bug.

- G
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS/BIND and file confusion ACDII Linux - General 2 07-27-2007 07:38 AM
File Sharing Confusion in Samba MykeV Linux - Server 3 07-24-2007 08:28 AM
confusion re read only file howarddevore Debian 2 07-06-2005 08:42 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM
File System confusion hotrodowner Linux - Software 1 07-04-2002 08:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration