top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

While running the file, Why am I able to delete a small file but not large file?

+2 votes
331 views

Lets say I have a file 1.c.

#include<stdio.h>
main()
{
    while(1);
}

If I compile this using, cc 1.c i will get an executable i.e. a.out
If I run this it will be in infinite loop, while this process is running I am able to delete a.out

Where in same case if I start some movie/video and then if I try to delete it then i will not be allowed to.

Why ?

posted Oct 29, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Just making a guess,

In case of small executable full binary is loaded into memory and further reference is not required while it is being in execution.
In case of Big Binary, file is not completely loaded into memory and it is referenced again and again so if we delete then reference may be lost that may be the reason.

Also when we execute the video the binary is the media player not the video.

answer Oct 29, 2015 by Salil Agrawal
Similar Questions
+5 votes
+2 votes

I am creating 500 binary files with one minute old time stamp. I am using windows API but it's very slow, so how can I improve the performance.

+1 vote
avinash@dell ~ $ sudo pip install django-tracking

Downloading/unpacking django-tracking
Downloading django-tracking-0.4.1.tar.gz (1.9MB): 1.9MB downloaded
Running setup.py (path:/tmp/pip_build_root/django-tracking/setup.py) egg_info for package django-tracking
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/django-tracking/setup.py", line 6, in
import tracking
File "tracking/__init__.py", line 1, in
import listeners
File "tracking/listeners.py", line 6, in
from django.core.cache import cache
File "/usr/local/lib/python2.7/dist-packages/django/core/cache/__init__.py", line 34, in
if DEFAULT_CACHE_ALIAS not in settings.CACHES:
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 46, in __getattr__
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 40, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 17, in

File "/tmp/pip_build_root/django-tracking/setup.py", line 6, in

import tracking

File "tracking/__init__.py", line 1, in

import listeners

File "tracking/listeners.py", line 6, in

from django.core.cache import cache

File "/usr/local/lib/python2.7/dist-packages/django/core/cache/__init__.py", line 34, in

if DEFAULT_CACHE_ALIAS not in settings.CACHES:

File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 46, in __getattr__

self._setup(name)

File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 40, in _setup

% (desc, ENVIRONMENT_VARIABLE))

django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

...