The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
stty erase r bishweshwar UNIX for Advanced & Expert Users 5 11-27-2006 06:10 AM
erase and interrupt keys chrs0302 UNIX for Dummies Questions & Answers 1 06-21-2005 06:24 PM
stty erase e command CEngel0327 UNIX for Dummies Questions & Answers 1 10-27-2002 03:19 PM
Erase files and directory odogbolu98 Shell Programming and Scripting 3 09-13-2002 01:56 PM
Is there an unrecoverable erase command? snyderpa UNIX for Dummies Questions & Answers 5 11-03-2000 11:39 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-10-2005
ust ust is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 98
erase file

I have a file that always generated in the system eg. /tmp/log.txt , it is generated by the application program , but this file should not be present in the system otherwise there are some program problem , I want to erase this file once the program has generate it , as I know , it can link to /dev/null , could suggest how to make it


I use the s.link function , it is OK to link the file , but the /tmp/log.txt is exist , even the file can't be update but I really don't want the file exist in the system , how can I make the file don't appear in the system ( even the file size is 0 ) ? thx


/tmp/log.txt -- > /dev/null
  #2 (permalink)  
Old 03-10-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
As you stated, link it to /dev/null if you don't want it. Instead of having the real file, it will be a link to /dev/null. Use a startup script to insure it's a link while booting (and have the script create it if it isn't there.) before the application starts. Realize that some testing may be needed as the application may not like the fact that it's a link.

I also wonder why, if this file is a sign of a program error, why you want to get rid of it - instead of fixing it so the file is a link to /dev/null, fix the program!
  #3 (permalink)  
Old 03-10-2005
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
You can also truncate a file to size zero

Depending on your shell
Code:
> filename
# or
cat /dev/null > filename
And RTM has it - why not fix the program?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0