Sponsored Content
Top Forums Programming Storing a Temporary File Using C Post 302931500 by metallica1973 on Tuesday 13th of January 2015 11:25:06 AM
Old 01-13-2015
Essentially in a nutshell this is what I am trying to achieve:

1 - Temporary download /etc/vpnc/test.conf to tmp_file
2 - Search for a line in tmp_file
3 - print out the results of my findings
4 - Delete tmp_file

As always, many thanks for your help
 

10 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

remove temporary file ?

Hi all, In the script I am creating a temporary file with process id as temp.txt.$$ I want to remove this tomporary file first from the current directory when i'll run the same script next time. Note: Every time when the script executes then it has unique process id and it'll create a... (5 Replies)
Discussion started by: varungupta
5 Replies

3. AIX

error : pg: 0652-122 Cannot write to the temporary file

Hi All, I'm getting this error when I use "pg". /tmp is not full and the permission is correct. root@axappk01::/home> hostname|pg pg: 0652-122 Cannot write to the temporary file. Please advise. (6 Replies)
Discussion started by: fara_aris
6 Replies

4. Shell Programming and Scripting

Perl : how to modify a file without generate a temporary file

Hi All, I have a file like below, how can i insert one line after line 1 without using a temporary file in perl? line 1 line 2 line 3 expected result line 1 new line <---insert here line 2 line 3 (2 Replies)
Discussion started by: summer_cherry
2 Replies

5. Shell Programming and Scripting

temporary file to file then move to directory

Ok in my bash script i have 5 options to create a simple html script. I need to create a temporary file and whatever the user types will be stored in that file using html codes. And then I have another option in which that temporary file will be moved to the public_html directory in which the user... (19 Replies)
Discussion started by: gangsta
19 Replies

6. UNIX for Dummies Questions & Answers

mailx command - Temporary mail file: permission denied

Hi , I am facing a problem with respect to mailx command in unix . Earlier it was working fine and I am facing this issue only from last week . I used mailx command and I am getting a error message as follows : temporary mail file: Permission denied If I run mailx command from... (2 Replies)
Discussion started by: deepav1985
2 Replies

7. Shell Programming and Scripting

How to remove the first line of a file without using any temporary file

I want remove first line of the file without using any temporary file. Everything should be done in the original file itself since I don't any file creation access whereas I have modify access. It would be great if somebody help in this regard ASAP . Thanks in Advance. Kishore:mad: (1 Reply)
Discussion started by: tvbhkishore
1 Replies

8. Shell Programming and Scripting

How to remove a temporary file inside gawk

Hi- How can I make the temporary file 0 byte , created inside gawk. I am using system("rm -f temp_orders"); It seems system command is deleting file permanently and I am not able to execute below statement. print ORD_HEAD_FULL >> cFILE; (cFile is temp_orders) (2 Replies)
Discussion started by: ashish_kaithi
2 Replies

9. UNIX for Dummies Questions & Answers

Mailx - temporary mail message file: No such file or directory

How would I go about resolving this error temporary mail message file: No such file or directory Can anybody tell me where the default location is for the temporary mail message file is for mailx? It appears that it doesn't exist. Thanks (1 Reply)
Discussion started by: joen
1 Replies

10. UNIX for Beginners Questions & Answers

Finding specific string in file and storing in another file

Text in input file is like this <title> <band height="21" isSplitAllowed="true" > <staticText> <reportElement x="1" y="1" width="313" height="20" key="staticText-1"/> <box></box> <textElement> <font fontName="Arial" pdfFontName="Helvetica-Bold"... (4 Replies)
Discussion started by: aankita30
4 Replies
WWW::Search::Test(3pm)					User Contributed Perl Documentation				    WWW::Search::Test(3pm)

NAME
Test - utilities to aid in testing WWW::Search backends SYNOPSIS
$oTest = new WWW::Search::Test('HotBot,Yahoo,Excite'); $oTest->test('HotBot', 'Kingpin', 'one', $sQuery, $TEST_RANGE, 1, 10); DESCRIPTION
See file test.pl in the WWW-Search-HotBot distribution for a detailed "real-world" example. METHODS AND FUNCTIONS
find_websearch Returns the full path of an executable WebSearch program, or undef if none can be found. new Create a new WWW::Search::Test object. All arguments are strings, names of backends that this object will be able to test. If no arguments are given, will be able to test all backends. mode Set / get the test mode of this object. If an argument is given, sets the mode to that value. Returns the current (or newly set) value. There are three test modes available. They are: $MODE_INTERNAL: parse URLs out of saved pages (as a sanity check or regression test); $MODE_EXTERNAL: send the query to the search engine "live", parse the results, and compare them to the previously saved results; and $MODE_UPDATE: send the query to the search engine "live", parse the results, and save them for future testing. relevant_test Given the name of a backend, returns true if this Test object is able to test that backend. eval_test Given the name of a backend, grabs the $TEST_CASES variable from that backend and evaluates it. test Run test(s) for a backend. Arguments are, in order: name of a backend to test (string, required); name of backend maintainer (string, if undef $backend::MAINTAINER will be used); filename for results storage/comparison (string, required); query to be sent to backend (string, required); test method (required, one of the following). Several test methods are possible: $TEST_EXACTLY: list of URLs must match exactly (line for line, in order); $TEST_BY_COUNTING: test passes if number of resulting URLs is equal; $TEST_GREATER_THAN: test passes if we get more than N result URLs; and $TEST_RANGE: like $TEST_GREATER_THAN but constrained on both ends. no_test Prints a message stating that this backend does not have a test suite. Takes two arguments, the backend name and the name of the maintainer. not_working Prints a message stating that this backend is known to be broken. Takes two arguments, the backend name and the name of the maintainer. not_working_with_tests Prints a message stating that this backend is known to be broken even though it has a test suite. Takes two arguments, the backend name and the name of the maintainer. not_working_and_abandoned Prints a message stating that this backend is known to be broken and is not being actively maintained. Takes two arguments, the backend name and the name of the maintainer. reset_error_count Reset the counter of errors to zero. You probably want to call this before each call to test() or eval_test(). wc_l (private, not a method) Given a filename, count the number of lines of text contained within the file. (I.e. simulate running UNIX command "wc -l" on a file) diff (private, not a method) Given two files, returns TRUE if contents are line-by-line different, or FALSE if contents are line-by-line same. (I.e. like the UNIX command diff, but just reports true or false) Shortcuts for running backend tests WWW::Search::Test keeps its own count of test numbers, so if you want to mix-and-match these functions with your own tests, use the $WWW::Search::Test::iTest counter. new_engine One argument: the name of a backend suitable to be passed to WWW::Search::new(). Prints 'ok' or 'not ok' and the test number. Creates a WWW::Search object internally, to be used for all subsequent calls to run_test and run_gui_test (see below). tm_new_engine Same as new_engine(), but uses Test::More instead of just printing 'ok'. run_test Three arguments: a query string, NOT escaped; a minimum number of expected results; and a maximum number of expected results. Optional fourth argument: integer value to be used as the search_debug. Optional fifth argument: send any true value to dump the search results. Optional sixth argument: reference to hash of search options (see backend documentation). Optional seventh argument: send any true value to NOT escape the query string. If the minimum is undef, assumes zero. If the maximum is undef, does not check. Prints 'ok' or 'not ok' and the test number. run_gui_test Same as run_test(), but calls gui_query() instead of native_query(). tm_run_test Same as run_test(), but uses Test::More rather than just printing 'ok'. Note: If you use this function inside a TODO block, you must set global variable $TODO rather than a local $TODO, and you must set the global $TODO back to empty-string (or undef) at the end of your TODO block. For example: TODO: { $TODO = 'I have not fixed this yet'; tm_run_test(...); $TODO = ''; } # end of TODO block tm_run_test_no_approx Same as tm_run_test, but does NOT check the approximate_result_count. count_results Run a query, and return the actual (not approximate) number of hits. Required first argument determines which backend query method to call: 'gui' to call gui_query(), anything else to call native_query(). Remaining arguments are same as all the run_test() arguments. skip_test You can call this function instead of run_test() or run_gui_test() if the current test must be skipped for any reason. test_most_results Given an arrayref of things to test, runs all those things against all the results of the most-recently executed test search. perl v5.12.4 2011-10-25 WWW::Search::Test(3pm)
All times are GMT -4. The time now is 04:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy