Sponsored Content
Top Forums Shell Programming and Scripting Writing files without temporary files Post 302308288 by Ikon on Friday 17th of April 2009 03:28:36 PM
Old 04-17-2009
Code:
FILE=`tail -n 59 activity.file`; echo "$FILE" > activity.file ; echo "activityN" >> activity.file

 

7 More Discussions You Might Find Interesting

1. Ubuntu

Avoid creating temporary files on editing a file in Ubuntu

Hi, My ubuntu flavor always create temporary files having filename followed by ~ on editing. For eg: if I am editing a file called "sip.c", automatically a temporary (bkup) file is getting created with the name "sip.c~". How to avoid this file creation? (7 Replies)
Discussion started by: royalibrahim
7 Replies

2. Shell Programming and Scripting

Temporary files and rm

Hello everyone, I am creating a temporary file in my ksh by using something file filetemp=filetemp.$$ Later on in my script I write to the file $filetemp by 'cat'ing to it. Then in the script I am doing a 'less' on the file to view it. At the end of the script I issue a rm $filetemp 2>... (4 Replies)
Discussion started by: gio001
4 Replies

3. Shell Programming and Scripting

Help - Bug: A script to compile two types of data files into two temporary files

Dear other forum members, I'm writing a script for my homework, but I'm scratching all over my head and still can't figure out what I did wrong. Please help me. I just started to learn about bash scripting, and I appreciate if anyone of you can point out my errors. I thank you in advance. ... (3 Replies)
Discussion started by: ilove2smoke
3 Replies

4. Shell Programming and Scripting

Rsync temporary files

Hi, I am looking to use rsync in a very specific way, and even though I have trawled the rsync man pages I have not succeeded in seeing a way of doing the following: The temporary files created by rsync should not be created in the destination directory. (I have used --temp-dir option to... (0 Replies)
Discussion started by: LostInTheWoods
0 Replies

5. UNIX for Advanced & Expert Users

Which time should be used for deleting temporary files?

I want to create a folder for users to put their temporary files and a folder for users to put their permanent files. For the temporary folder, I need to implement a deletion policy. I would like to know normally which time, ctime, mtime or atime, should be used to implement such deletion policy. (1 Reply)
Discussion started by: marctc
1 Replies

6. AIX

Hidden temporary files in AIX

Hi, Some porocess is creating hidden temporary files in /tmp directory. And they are not getting deleted. System is going out of disk space after some days. The temp files are getting created like .<user name><pid>. I have checked the application code, but didnt get any clue. Does these files... (4 Replies)
Discussion started by: viswath.sen
4 Replies

7. Homework & Coursework Questions

Help with exit, grep, temporary files, awk

1. The problem statement, all variables and given/known data: I do not understand how/why the following code is used. Please do not simply refer me to the man pages since I have already reviewed them extensively. Thank you. exit 2 , exit 3, exit 0 I understand the basics of why the exit... (5 Replies)
Discussion started by: BartleDoo
5 Replies
os_activity_initiate(3) 				   BSD Library Functions Manual 				   os_activity_initiate(3)

NAME
os_activity_initiate, os_activity_initiate_f -- activity related routines SYNOPSIS
#include <os/activity.h> void os_activity_initiate(const char *description, uint32_t flags, void (^activity_block)(void)); void os_activity_initiate_f(const char *description, uint32_t flags, void *ctx, void function(void *ctx)); DESCRIPTION
An activity is essentially an identifier that is created by the system. The identifier is transported with work via GCD, XPC and other mecha- nisms. The identifier simplifies debugging programs since it correlates the trace and log messages to the area in question. Although an activity appears to have a start/end, it is only finished when no other work related to it is enqueued to be processed. Activity functions only allow constant strings for performance and privacy, similar to os_trace(3). Supported Activity Name: os_activity_initiate("indexing database", OS_ACTIVITY_FLAG_DEFAULT, ^(void) { [self indexDatabase]; }); Unsupported Activity Name: snprintf(buffer, "indexing database for %s", username); os_activity_initiate(buffer, OS_ACTIVITY_FLAG_DEFAULT, ^(void) { [self indexDatabase]; }); os_activity_initiate and os_activity_initiate_f wraps the block or function with a new activity. EXAMPLES
Example use of activity with a message. #include <os/trace.h> #include <os/activity.h> - (IBOutlet) indexDatabase:(id) sender { os_activity_initiate("index database", OS_ACTIVITY_FLAG_DEFAULT, ^{ os_trace("re-indexing database for %d", self.uid); [self reIndex: self.uid]; }); } SEE ALSO
os_trace(3), os_log(3) Darwin June 1, 2019 Darwin
All times are GMT -4. The time now is 03:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy