Sponsored Content
Top Forums Programming Copying and overwriting a file using file descriptor Post 302466406 by Corona688 on Tuesday 26th of October 2010 10:31:11 AM
Old 10-26-2010
Is this homework?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

file activity (open/closed) file descriptor info using KORN shell scripting

I am trying to find a way to check the current status of a file. Such as some cron job processes are dependent on the completion of others. if a file is currently being accessed / modified or simply open state I will wait until it is done being processed before attempting the next process on that... (3 Replies)
Discussion started by: Gary Dunn
3 Replies

2. Programming

Get the file descriptor of a socket file. C vs Python.

Hi, I want to validate that a file is a socket file on Linux. I know I can do this using the S_ISSOCK macro, but I am not sure how to get the file descriptor for the socket file. For example, I know that /tmp/mapping-foo is a socket file. In Python I can do something like this: >>> import... (2 Replies)
Discussion started by: goon12
2 Replies

3. Shell Programming and Scripting

Overwriting File

How to overwrite every time a particular portion of a file? ---------- Post updated at 02:16 PM ---------- Previous update was at 02:07 PM ---------- I have a file whose contents are something like: Output of "apachectl fullstatus" command: ---------------------------------------------... (3 Replies)
Discussion started by: proactiveaditya
3 Replies

4. UNIX for Dummies Questions & Answers

Difference between file descriptor and file pointer

hi...., can anyone tell me what is the exact difference between file descriptor and file pointer...... and why file descriptor takes integer value???:confused: (10 Replies)
Discussion started by: jimmyuk
10 Replies

5. Linux

Is it possible to revert a file after overwriting it ?

Long story short, there was some sort of corruption with my ide and the script I was working on has been over written with nothing (the file is blank now). The IDE doesn't store a back up from what I know (I'm using notepadd++ in wine lol I know I know I'm addictted to the nppftp sidebar and geany... (1 Reply)
Discussion started by: noPermissions
1 Replies

6. UNIX Desktop Questions & Answers

overwriting on a file

I have loads of files in different directories which I do miner changed on them and till now I have to create totally new directories for them, specially as I deal with a whole directory at once :wall::wall::wall::wall: it creates such as mess really e.g. FILES="F1/*" for X in $FILES do... (2 Replies)
Discussion started by: A-V
2 Replies

7. Shell Programming and Scripting

Overwriting file with sftp

I have a script, which runs through cronjob every night 9 PM. It is supposed to do following tasks -- 1- Connect to ftp.testsite.com via user redtest 2- Fetch file red_bill.txt to my local server, where my script is residing. 3- Rename red_bill.txt to red_bill.V01.txt everyday on sftp server.... (4 Replies)
Discussion started by: solaris_1977
4 Replies

8. Shell Programming and Scripting

File overwriting

Hi, An application is transferring a file to linux system with same file name. As file is transferring with same name always file will be overwritten. In this case we want to know what times file was overwirtten like below. Modify: 2014-05-12 00:52:01.000000000 Modify: 2014-05-12... (2 Replies)
Discussion started by: Satyak
2 Replies

9. Shell Programming and Scripting

sed is not overwriting a file

hi i have a file as in follwoing: cat apple.txt Apple is a fruit But this fruit is costly Now I used the sed command and i see output as in following # sed 's/fruit/healthy &/' fruit.txt Apple is a healthy fruit But this healthy fruit is costly # sed works fine here. But... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

10. Shell Programming and Scripting

Avoid overwriting backup file when multiple entries need to replace in one file input from another

Hello, I have been working on script in which search and replace the multiple pattern. 1. update_params.sh read the multiple pattern from input file ParamMapping.txt(old_entry|New_entry) and passing this values one by one to change_text.sh 2. change_text.sh read... (0 Replies)
Discussion started by: ketanraut
0 Replies
Font::TTF::Name(3)					User Contributed Perl Documentation					Font::TTF::Name(3)

NAME
Font::TTF::Name - String table for a TTF font DESCRIPTION
Strings are held by number, platform, encoding and language. Strings are accessed as: $f->{'name'}{'strings'}[$number][$platform_id][$encoding_id]{$language_id} Notice that the language is held in an associative array due to its sparse nature on some platforms such as Microsoft ($pid = 3). Notice also that the array order is different from the stored array order (platform, encoding, language, number) to allow for easy manipulation of strings by number (which is what I guess most people will want to do). By default, $Font::TTF::Name::utf8 is set to 1, and strings will be stored as UTF8 wherever possible. The method "is_utf8" can be used to find out if a string in a particular platform and encoding will be returned as UTF8. Unicode strings are always converted if utf8 is requested. Otherwise, strings are stored according to platform: You now have to set <$Font::TTF::Name::utf8> to 0 to get the old behaviour. Apple Unicode (platform id = 0) Data is stored as network ordered UCS2. There is no encoding id for this platform but there are language ids as per Mac language ids. Mac (platform id = 1) Data is stored as 8-bit binary data, leaving the interpretation to the user according to encoding id. Unicode (platform id = 2) Currently stored as 16-bit network ordered UCS2. Upon release of Perl 5.005 this will change to utf8 assuming current UCS2 semantics for all encoding ids. Windows (platform id = 3) As per Unicode, the data is currently stored as 16-bit network ordered UCS2. Upon release of Perl 5.005 this will change to utf8 assuming current UCS2 semantics for all encoding ids. INSTANCE VARIABLES
strings An array of arrays, etc. METHODS
$t->read Reads all the names into memory $t->out($fh) Writes out all the strings $t->XML_element($context, $depth, $key, $value) Outputs the string element in nice XML (which is all the table really!) $t->XML_end($context, $tag, %attrs) Store strings in the right place is_utf8($pid, $eid) Returns whether a string of a given platform and encoding is going to be in UTF8 find_name($nid) Hunts down a name in all the standard places and returns the string and for an array context the pid, eid & lid as well remove_name($nid) Removes all strings with the given name id from the table. set_name($nid, $str[, $lang[, @cover]]) Sets the given name id string to $str for all platforms and encodings that this module can handle. If $lang is set, it is interpretted as a language tag and if the particular language of a string is found to match, then that string is changed, otherwise no change occurs. If supplied, @cover should be a list of references to two-element arrays containing pid,eid pairs that should be added to the name table if not already present. This function does not add any names to the table unless @cover is supplied. Font::TTF::Name->match_lang($pid, $lid, $lang) Compares the language associated to the string of given platform and language with the given language tag. If the language matches the tag (i.e. is equal or more defined than the given language tag) returns true. This is calculated by finding whether the associated language tag starts with the given language tag. Font::TTF::Name->get_lang($pid, $lid) Returns the language tag associated with a particular platform and language id Font::TTF::Name->find_lang($pid, $lang) Looks up the language name and returns a lang id if one exists Font::TTF::Name->pe_list() Returns an array of references to two-element arrays containing pid,eid pairs that already exist in this name table. Useful for creating @cover parameter to set_name(). BUGS
o Unicode type strings will be stored in utf8 for all known platforms, once Perl 5.6 has been released and I can find all the mapping tables, etc. AUTHOR
Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright and licensing. perl v5.16.3 2012-07-24 Font::TTF::Name(3)
All times are GMT -4. The time now is 02:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy