In A Cpp Application I Am Deleting A File On A Partition, But Space Is Not Freeing..

1) deleting file using remove() call
2) no other hard link for the file
3) tried to close file descriptor using following scripts then remove() call
-------
for fd in $(ls /proc/$$/fd); do
case "$fd" in
0|1|2|255)
;;
*)
eval "exec $fd>&-"
;;
esac
done
-------

But space not freed

4) I tried with truncate() and then remove() call Now files deleted and space freed

Is it the only and right way to do this?


Similar Content



Installing 17.1 Mate With Windows 8.1

Hello, I hope someone can assist. I have installed 17 on 2 laptops and 17.1 on another all with windows 8 upgraded to 8.1 Now I have a new PC with 8.1 and cannot get 17.1 to install. I go thru all the steps but when I get past "something else" and choose the "free space" that I partitioned in windows and hit install the window pops up with "no root file system is defined" "Please correct from partitioning menu.. I have never had this happen, did I not do something? There is 1 300mb(fat32, efi) partition, ntfa, free space(which is where I am trying to install Linux), 1 small and 1 large "free space". Then the define for boot loader installation, which I do not remember needing to do before. Can someone please help. The PC is an Acer Aspire, amd10, 3.7ghz, quad core, radeon hd 8670 graphics , 1 terabyte hdd, 4gb ram, windows 8.1

Remove Lines That Are Subsets Of Other Lines In File

Hello everyone,


Although it seems easy, I've been stuck with this problem for a moment now and I can't figure out a way to get it done.

My problem is the following:

I have a file where each line is a sequence of IP addresses, example :

Line 1: 10.0.01 10.0.0.2
Line 2 : 10.0.0.5 10.0.0.1 10.0.0.2
...

What I'd like to do, is to remove lines that are completely matched in other lines. In the previous example, "Line 1" would be deleted as it is contained in "Line 2".

So far, I've worked with python and set() objects to get the job done but I've got more than 100K lines and sets lookups are becoming time consuming as the program goes :/

Thanks for you help

Remove Everything Before In Txt File?

So,

hopefully this is the right section to ask this in!

I'm looking to remove everything before in a txt file so long story short i've made a number wordlist with Crunch im basically wanting to remove all the unless numbers to numbers i want to start with.

so everything before 1232120000 i want to remove from the txt file i've heard you can do it with sed or awk im not familiar with using sed or awk.

Cygwin Rsync Script Copying File Incorrectly

I am trying to write a simple test script that executes a single rsync call. Once I get the syntax right, the script will be expanded to incorporate several rsync instructions to save me time.

I'm using a Cygwin Terminal on Windows 7 to run Rsync.

The script is called "backup" and I call it from the cygwin terminal using "./backup". Have used chmod to make it executable.

When I execute the rsync instruction as a standalone instruction at terminal prompt, the file copies to the target folder perfectly.

However, when I try and drop the same instruction into a script, it copies the file over from it's original file name "mvi_1840.mov" to a file with the name "." -- literally a single period. I can rename the file to a .mov file and it works fine but naturally, I don't want to have to do this.

The one other thing I will mention is that the file is located in the /home/"username" directory in cygwin vs /bin. But I would not think that this would make a difference.

I have pasted the contents of the script file below:
Code:
#!/bin/bash
    rsync.exe -rltDvP --exclude "System Volume Information" --exclude
 "RECYCLER" --exclude=\$RECYCLE.BIN --delete "/cygdrive/c/users/<USERNAME>
/desktop/mvi_1840.mov" "/cygdrive/c/users/<USERNAME>/desktop/test/"

Any help would be greatly appreciated!

Thanks

Disappearing Hard Drive Space

when i download, the file disappears, but it takes up space like its been downloaded. where did the file go, and more importantly, how do i find it. my space keeps disappearing

find / -iname file - turned up nothing

debian 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1

I Am Trying To Install Mukulu Linux On A Desktop That Has XP On It .

I have followed all the instructions I have got from the net and made boot-able DVD's and USB sticks several different ways as people advise. I have done the same with Mint 17. I have created a partition (26G) and follow the install instructions 1: English 2:Has at least 7.4G available drive space. 4: Is connected to the internet. 5: Here it shows a page where I think it should display the drive options (but does not) If I push the "install now" button it comes up with an error "No root file system is defined --Please correct this from the partitioning menu" I close the installer and look at the drives in GParted and they are all there and the one I created for Linux is PARTITION - /dev/sda4 FILE SYSTEM - ext4
MOUNT POINT - /media/makulu/0C43086E0C43086E LABEL - Lin
SIZE - 26.02 GB USED - 590.07 Mb UNUSED - 24.44 GB FLAG - (blank)
No indication on how to fix the "No root file system" problem. I have tried so many bits of advise that I am beginning to think that I may be better of sticking to windows (perish the thought)
Can anyone help?
Col

Error:: "wrong # Args: Should Be "set VarName ?newValue?" " While Running TCL Script

I m learning Tcl and write short code. After running code i got same error repeatedly and not able to find mistake,,,i wrote it as it is from a tutorial. here is the code below

set ns [new Simulator]

set f1 [open out.nam w] #open nam file out.nam
$ns namtrace-all $f1

proc finish{} {
global ns f1
$ns flush-trace
#close $tracefile1
close $f1
exec nam out.nam &
exit 0
}


set n1 [$ns node] # 3 nodes defined
set n2 [$ns node]
set n3 [$ns node]

set duplex-link $n1 $n2 10mb 10ms Droptail
set duplex-link $n2 $n3 10mb 10ms DropTail
set duplex-link $n3 $n1 10mb 10ms DropTail

set udp1 [new Agent/UDP] #UDP agent attached to node n1
$ns attach-agent $n1 $udp1

set cbr1 [new Application/traffic/CBR]
$cbr1 set packetSize_ 500
$cbr1 set interval_ 0.005
$ns attach-agent cbr1 udp1

set null1 [new Aggent/Null]
$ns attach-agent $n2 $null1


$ns connect $udp1 $null1

$ns at 0.5 "$cbr0 start"
$ns at 4.5 "$cbr0 stop"


$ns at 12.0 "finish"

$ns run



ERROR:wrong # args: should be "set varName ?newValue?"
while executing
"set f1 [open out.nam w] #open nam file out.nam"
(file "11.tcl" line 19)

An Error Occurred During The File System Check

Hi all!! Im new in this forum and also new at linux !!

I am installing an application that includes automatically the instalation of CentOS 6.3.

The server that hosts this application and OS had a power outage and then when i turn on the server again i get the error that you can see in this pictu http://postimg.org/image/7opm0xzel/

I have 2 disks in the system, 1 for the application and SO and other to store call recordings (thats what the application do, record calls!).

If I re-install the system it has no problem!! But i dont want to re-install the system every time i have a power outage because i lost too much and important information.

I have installed this application in other server and had no problem with power outage. In this server the diference is that it originally had raid and i "remove it" frome the BIOS. Maybe here is the problem??

Anyone can help me?? Remember im really new in linux !!

Something's Wrong With GRUB

Ubuntu 12.04

I installed updates, which included a new kernel. I went to remove one of the older kernels and got:

Code:
jnojr@DEV:~$ sudo apt-get purge linux-image-3.13.0-46-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-46-generic gir1.2-ubuntuoneui-3.0 wireless-regdb iw
  linux-headers-3.13.0-46 crda linux-headers-3.5.0-23-generic lesstif2
  linux-headers-3.5.0-23 libubuntuoneui-3.0-1 thunderbird-globalmenu
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  linux-image-3.13.0-46-generic*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 197 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 340656 files and directories currently installed.)
Removing linux-image-3.13.0-46-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-46-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found memtest86+ image: /boot/memtest86+.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 146
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done
Purging configuration files for linux-image-3.13.0-46-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic

I have no idea how I'd "ensure there are no errors" in the /etc/grub related files... I have no idea what's supposed to be there. Looking at the line it's complaining about in /boot/grub/grub.cfg.new doesn't tell me anything. How do i find out what it's unhappy about?

Remove Write-protected Regular File Without Permission

I wanted to delete a couple of files, so I did. Then I noticed that they were "write-protected". What does that mean? Why was I able to delete the files considering I wasn't the owner and the files did not have group write permission?

Code:
[Michael@devserver backup_database]$ ls -l
total 4344
-rw-r--r--. 1 apache apache   50639 Feb  6 05:42 2015_02_06_05_42_01.sql
-rw-r--r--. 1 apache apache  654623 Feb  6 05:45 2015_02_06_05_45_54.sql
-rw-r--r--. 1 apache apache 3738269 Feb  6 05:49 2015_02_06_05_49_02.sql
[Michael@devserver backup_database]$ rm *
rm: remove write-protected regular file `2015_02_06_05_42_01.sql'? y
rm: remove write-protected regular file `2015_02_06_05_45_54.sql'? y
rm: remove write-protected regular file `2015_02_06_05_49_02.sql'? y
[Michael@devserver backup_database]$ ls -l
total 0
[Michael@devserver backup_database]$