Question about running a file
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Question about running a file




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Question about running a file  
Seth


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-17-07 06:21 PM

Hi,
my question is:
I have a fortran program under unix, and the execution of it can last
many minutes.
While this is running if i delete the file that i have just ran(from
the console) nothing happens, it finish is execution.
This is normal or just a coincidence? if i start a bin file its loaded
entirely into memory?so i can delete it from hd? o in some case it
could be an error?

thanks

Seth






[ Post a follow-up to this message ]



    Re: Question about running a file  
Rainer Temme


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-17-07 06:21 PM

Seth wrote:
> I have a fortran program under unix, and the execution of it can last
> many minutes.
> While this is running if i delete the file that i have just ran(from
> the console) nothing happens, it finish is execution.
> This is normal or just a coincidence? if i start a bin file its loaded
> entirely into memory?so i can delete it from hd? o in some case it
> could be an error?

Erasing a running file isn't tricky at all.

If the system loads the entiry file into memory, it will
have no need to access the file again. Therefore it doesn't
care if you delete this file.

If a system only loads that parts of a file it actually needs,
it will have incremented the usage-counter of the inode holding
the file (and will not decrement it until the binary stops its
execution). Therefore, even if you delete the file ... you only
delete the reference on this file in a certain directory of
the filesystem, but the inode holding the content of the file
is still undestroyed, since its usage-counter isn't yet zero.





[ Post a follow-up to this message ]



    Re: Question about running a file  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-17-07 06:21 PM

Seth <Seth7TS@gmail.com> writes:

> Hi,
> my question is:
> I have a fortran program under unix, and the execution of it can last
> many minutes.
> While this is running if i delete the file that i have just ran(from
> the console) nothing happens, it finish is execution.
> This is normal or just a coincidence? if i start a bin file its loaded
> entirely into memory?so i can delete it from hd? o in some case it
> could be an error?

Even if the file is not loaded entirely in memory, you can delete it,
and the kernel may still load missing parts later.

In unix, rm(1) or unlink(2) DO NOT delete the files.
There is NO syscall to delete any file in unix!

On the other hand, there is reference counting and a garbage collector.

When you use link(2) (ln(1) without -s) or open(2), you increment the
reference count.

When you use unlink(2) or close(2), you decrement the reference count.

The problem is that ls(1) only shows the reference count corresponding
to link/unlink, not to open/close.  Nonetheless, removing a link
DOESN'T delete the file.


The only thing that may suscitate the garbage collection of an i-node
blocks, is for the reference count to reach 0.


--
__Pascal Bourguignon__                     http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:17 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register