f



How to read a file using TCL

Hi,
   I am a new bee to TCL.  I want to write a script that opens the
file and reads it and prints to screen.  I have tried the below. But
doesn't works.

set INFILE [open "temp" a+]
set data [read $INFILE]
set data [split $data "\n"]
foreach line $data {
          puts $line
     }

-Regards
Swaroop Kumar Tata

0
5/14/2007 8:39:41 AM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

10 Replies
882 Views

Similar Articles

[PageSpeed] 3

On 14 Mai, 10:39, Swaroop <swaroop.t...@gmail.com> wrote:
> Hi,
>    I am a new bee to TCL.  I want to write a script that opens the
> file and reads it and prints to screen.  I have tried the below. But
> doesn't works.
>
> set INFILE [open "temp" a+]

You're opening in "a" (append) mode, that is, the file pointer puts at
the end. As you want to read the file, why not use mode "r", which is
default anyway? So just do
   set INFILE [open temp]


0
5/14/2007 9:20:49 AM
On May 14, 2:20 pm, suchenwi <richard.suchenwirth-
bauersa...@siemens.com> wrote:
> On 14 Mai, 10:39, Swaroop <swaroop.t...@gmail.com> wrote:
>
> > Hi,
> >    I am a new bee to TCL.  I want to write a script that opens the
> > file and reads it and prints to screen.  I have tried the below. But
> > doesn't works.
>
> > set INFILE [open "temp" a+]
>
> You're opening in "a" (append) mode, that is, the file pointer puts at
> the end. As you want to read the file, why not use mode "r", which is
> default anyway? So just do
>    set INFILE [open temp]


Hi,
   Its working when i use "r" mode.  But i am writing a script that
has the choices of adding a new entry to the file. Searching some
record in the file.  For that i have opend in a+ mode.  Do i need to
open and close for each function.  I mean if i am appending a line,
open file with a+ and close it.  if i want to read it open file with
"r" and close it...?

-Swaroop

0
5/14/2007 10:02:37 AM
On 14 Mai, 12:02, Swaroop <swaroop.t...@gmail.com> wrote:

>    Its working when i use "r" mode.  But i am writing a script that
> has the choices of adding a new entry to the file. Searching some
> record in the file.  For that i have opend in a+ mode.  Do i need to
> open and close for each function.  I mean if i am appending a line,
> open file with a+ and close it.  if i want to read it open file with
> "r" and close it...?

No. "a+" is append (write) as well as read. Just if you want to mix
modes, you should use [seek] to "move the pointer":
seek $INFILE 0       ;# before reading from beginning
seek $INFILE 0 end ;# before appending to end



0
5/14/2007 10:12:09 AM
On May 14, 3:12 pm, suchenwi <richard.suchenwirth-
bauersa...@siemens.com> wrote:
> On 14 Mai, 12:02, Swaroop <swaroop.t...@gmail.com> wrote:
>
> >    Its working when i use "r" mode.  But i am writing a script that
> > has the choices of adding a new entry to the file. Searching some
> > record in the file.  For that i have opend in a+ mode.  Do i need to
> > open and close for each function.  I mean if i am appending a line,
> > open file with a+ and close it.  if i want to read it open file with
> > "r" and close it...?
>
> No. "a+" is append (write) as well as read. Just if you want to mix
> modes, you should use [seek] to "move the pointer":
> seek $INFILE 0       ;# before reading from beginning
> seek $INFILE 0 end ;# before appending to end


Thanks Suchenwi...It works......

0
5/14/2007 10:14:19 AM
Swaroop wrote:
> Hi,
>    I am a new bee to TCL.  I want to write a script that opens the
> file and reads it and prints to screen.  I have tried the below. But
> doesn't works.
> 
> set INFILE [open "temp" a+]
> set data [read $INFILE]
> set data [split $data "\n"]
> foreach line $data {
>           puts $line
>      }

This is because the a and a+ modes seek to the end of the file. You 
would have to do:
  set INFILE [open "temp" a+]
  seek $INFILE 0 start
  ...
which is the same as just doing
  set INFILE [open "temp" w+]

However, if you are either reading the file in one place or appending to 
it in another then it is easier to use two separate [open]s which each 
do just what they need to (i.e. "r" in one place and "a" in another).

-- Neil
0
nem3909 (999)
5/14/2007 10:21:32 AM
On 14 May 2007 03:12:09 -0700, 
suchenwi <richard.suchenwirth-bauersachs@siemens.com> wrote:

> No. "a+" is append (write) as well as read. Just if you want to mix
> modes, you should use [seek] to "move the pointer":
> seek $INFILE 0       ;# before reading from beginning
> seek $INFILE 0 end ;# before appending to end

Do you actually need to seek to the end of the file to write?

I had the impression that in append mode an inherent seek is ALWAYS
performed prior to any write, usually by the OS itself.  Or does TCL
simply open the file for writing as with w or w+, and move the file
pointer to the end once at the start?

In the documentation I was just looking at, the description of APPEND
for the C API version of the [open] command seems to suggest an "always
seek to end" approach.  So I'm wondering just what the deal is?

Personally, I'd love it if a+ would hold the file pointer still during
a write, and just "append" the data to the end of the file.


Fredderic
0
5/14/2007 10:22:28 AM
Fredderic wrote:
> On 14 May 2007 03:12:09 -0700, 
> suchenwi <richard.suchenwirth-bauersachs@siemens.com> wrote:
> 
>> No. "a+" is append (write) as well as read. Just if you want to mix
>> modes, you should use [seek] to "move the pointer":
>> seek $INFILE 0       ;# before reading from beginning
>> seek $INFILE 0 end ;# before appending to end
> 
> Do you actually need to seek to the end of the file to write?
> 
> I had the impression that in append mode an inherent seek is ALWAYS
> performed prior to any write, usually by the OS itself.  Or does TCL
> simply open the file for writing as with w or w+, and move the file
> pointer to the end once at the start?
> 
> In the documentation I was just looking at, the description of APPEND
> for the C API version of the [open] command seems to suggest an "always
> seek to end" approach.  So I'm wondering just what the deal is?

[open $file APPEND] will seek to end before each write, whereas [open 
$file a/a+] will just seek to end initially, as stated in the open.n 
manpage.

-- Neil
0
nem3909 (999)
5/14/2007 11:36:02 AM
On Mon, 14 May 2007 12:36:02 +0100, 
Neil Madden <nem@cs.nott.ac.uk> wrote:

> > I had the impression that in append mode an inherent seek is ALWAYS
> > performed prior to any write, usually by the OS itself.  Or does TCL
> > simply open the file for writing as with w or w+, and move the file
> > pointer to the end once at the start?
> [open $file APPEND] will seek to end before each write, whereas [open 
> $file a/a+] will just seek to end initially, as stated in the open.n 
> manpage.

I didn't realise those keyword modes worked in the TCL [open] command
also...  Okay...  To set things straight...

If a/a+ mode, it does one seek to the end, and then behaves exactly
like w/w+ mode would.  Where the word "APPEND" invokes the full
seek-to-end-every-write behaviour...?

So how do they both behave if you're writing, for example, to a log
file which is also being updated by another process?

I'm guessing the a/a+ would start over-writing another process's
additions, whereas the APPEND keyword would do what I'd expect, and
actually append even if something else has come along and added stuff
to the end in the meantime.

Or am I still utterly and hopelessly confused?  ;)


Fredderic
0
5/14/2007 11:53:20 AM
Fredderic wrote:
....
> If a/a+ mode, it does one seek to the end, and then behaves exactly
> like w/w+ mode would.  Where the word "APPEND" invokes the full
> seek-to-end-every-write behaviour...?

Yes.

> So how do they both behave if you're writing, for example, to a log
> file which is also being updated by another process?
> 
> I'm guessing the a/a+ would start over-writing another process's
> additions, whereas the APPEND keyword would do what I'd expect, and
> actually append even if something else has come along and added stuff
> to the end in the meantime.

Yes. Which is why all logging utilities (should) use {APPEND CREAT 
WRONLY}. See http://wiki.tcl.tk/1241 for a discussion, when that site 
becomes available again (or use Google cache).

-- Neil
0
nem3909 (999)
5/14/2007 12:06:05 PM
In article <1179136957.617119.157810@e65g2000hsc.googlegroups.com>,
Swaroop  <swaroop.tata@gmail.com> wrote:
>On May 14, 2:20 pm, suchenwi <richard.suchenwirth-
>bauersa...@siemens.com> wrote:
>> On 14 Mai, 10:39, Swaroop <swaroop.t...@gmail.com> wrote:
>>
>> > Hi,
>> >    I am a new bee to TCL.  I want to write a script that opens the
>> > file and reads it and prints to screen.  I have tried the below. But
>> > doesn't works.
>>
>> > set INFILE [open "temp" a+]
>>
>> You're opening in "a" (append) mode, that is, the file pointer puts at
>> the end. As you want to read the file, why not use mode "r", which is
>> default anyway? So just do
>>    set INFILE [open temp]
>
>
>Hi,
>   Its working when i use "r" mode.  But i am writing a script that
>has the choices of adding a new entry to the file. Searching some
>record in the file.  For that i have opend in a+ mode.  Do i need to
>open and close for each function.  I mean if i am appending a line,
>open file with a+ and close it.  if i want to read it open file with
>"r" and close it...?
			.
			.
			.
It occurs to me that, after you've digested the excellent advice
given in other follow-ups, <URL: http://wiki.tcl.tk/17396 > might
be of interest.
0
claird (2363)
5/14/2007 2:42:39 PM
Reply:

Similar Artilces:

Sourcing a TCL file from within a tcl file
I am a newbie which I am sure I don't need to state :) I am trying to create a variable with a TCL file that will source another tcl file when I type the variable name something like this if I enter A through my keyboard then source a.tcl Can someone show me how to do this thanks guy On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote: > I am a newbie which I am sure I don't need to state :) > > I am trying to create a variable with a TCL file that will source > another tcl file when I type the variable name > > something like this > > if I enter A through my keyboard =A0then source a.tcl > > Can someone show me how to do this > > thanks > guy What you are asking is not hard. Will your program have a graphical user interface? Aric On Dec 10, 3:26=A0pm, Aric Bills <aric.bi...@gmail.com> wrote: > On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote: > > > I am a newbie which I am sure I don't need to state :) > > > I am trying to create a variable with a TCL file that will source > > another tcl file when I type the variable name > > > something like this > > > if I enter A through my keyboard =A0then source a.tcl > > > Can someone show me how to do this > > > thanks > > guy > > What you are asking is not hard. =A0Will your program have a graphical > user interface? > > Aric no I am just using this script...

How to read an Excel file using TCL Scripts
Hi all, I have an excel file test.xls.It is created manually and few values are added manually. I Want to read each column of the excel and store in some variable using TCL Scripts. I went thro lot of examples but nothing related to above requirement I found. Please give suggestions or links where this code is given. Thanks in Advance, RAGHU On 25 =D0=BD=D0=BE=D1=8F, 12:55, RAGHU <ragh...@gmail.com> wrote: > I Want to read each column of the excel and store in some variable > using TCL Scripts. Open http://wiki.tcl.tk/tcom and search for "Extract some cells from an Excel file". On 25 Nov., 10:55, RAGHU <ragh...@gmail.com> wrote: > Hi all, > > I have an excel file test.xls.It is created manually and few values > are added manually. > > I Want to read each column of the excel and store in some variable > using TCL Scripts. > > I went thro lot of examples but nothing related to above requirement I > found. > > Please give suggestions or links where this code is given. > > Thanks in Advance, > RAGHU This question was here 1 or two months ago. Check the mailing list or search in the wiki. hi Raghu, Save the excel file into csv format... thsi will then give you a comma separated values... since it is separated by comma you can use the tcl comman to "split". split "\n" string to split per row.. split "," string to split per co...

Problem using grep command in tcl and reading multiple files
Hi All, I am a newbie to tcl and i am having problem performing some of basic operations using tcl. I am having a centralized location in server where i am large number of directories with all user logins and each directory is having some log files with *.log extension. My requirement is to identify directories with my login id and then go into each directory and append all the information available in *.log files into one file. Problem 1: For identifying directory name with my login, i am using exec ls | grep <USERNAME> But it is returning "child process exited abnormally" If i run exec ls only, it lists down all the directories. What is wrong with "exec ls | grep <USERNAME>" Other related question, in tcl is there any inbuilt command that can be used to grep directories with a particular login like file command? Problem2: Other question is regarding opening multiple files and dumping in one file. I am trying following code set file_handle [open "*.log" "r"] But is giving error. So i think i should do it like set list_dir [glob *.log] foreach file_name $list_dir { set file_handle [open $file_name "r"] lappend list_var [reads $file_handle] close $file_handle } Is this the only way to do it, is there any shortcut to do it like in unix we can do "cat *.log > filename" in tcl? Thanks At Wed, 25 May 2011 07:16:34 -0700 (PDT) sunny <techbie.wordpress@gmail.com> wrote: > >...

How can I use tcl to read files written in GBK or GB18030 encoding?
I know that Tcl has quite a large list of encodings that it supports. However, I've a request for guidance by someone who needs to read files using either GBK or GB18030 (I think these are alternate names for the same encoding...). Has anyone worked out what one needs to do for this? On 31 Jan., 16:26, "Larry W. Virden" <lvir...@gmail.com> wrote: > I know that Tcl has quite a large list of encodings that it supports. > However, I've a request for guidance by someone who needs to read > files using either GBK or GB18030 (I think these are alternate names > for the same encoding...). > > Has anyone worked out what one needs to do for this? From Wikipedia I see that GB18030 has a structure vaguely similar to UTF-8, but more complicated: 1st byte 00..7F: ASCII, 1 byte 81..FE: 2nd byte 40..FE: GB2312 Chinese character, 2 bytes 30..39: Extended character, 4 bytes Extended characters have ranges 81..FE 30..39 81..FE 30..39, with which all Unicode points are represented that aren't in ASCII or GB2312. The relation between Unicode and Extended cannot be computed, but must come from a lookup table. The difference between GB18030 and GBK is trifle and concerns only the Euro sign: 0x80 in Microsoft's later versions of GBK and a two byte code of A2 E3 in GB18030. http://en.wikipedia.org/wiki/GB_18030 has a link to the "authoritative mapping table". Whether Tcl's enc...

how can i read the last line of a file using tcl console commands???
hi, all, i want to read some thing from an increasing file which was written from another procedure by the same time, how can i do that?? Thankyou ! best regards Ning. PH.D.Condidater.Li.Ning wrote: > hi, > all, > i want to read some thing from an increasing file which was written > from another procedure by the same time, > how can i do that?? > > Thankyou ! > best regards > > Ning. > see http://wiki.tcl.tk/tail and related pages linked there. Bruce In article <1190213992.898044.6150@y27g2000pre.googlegroups.com>, PH.D.Condidater.Li.Ning <nealleehit@gmail.com> wrote: >hi, >all, >i want to read some thing from an increasing file which was written >from another procedure by the same time, . . . <URL: http://wiki.tcl.tk/tail > ...

how to read file in tcl
in the condition that giving some coordinate of polygon in a directory and i have to read these file without using the command create poly how to call these file from the directory? In article <36940419.0308110031.66a5cd1@posting.google.com>, K Zewi <prowarcraftplayer@yahoo.com> wrote: >in the condition that >giving some coordinate of polygon >in a directory and i have to >read these file without using >the command create poly >how to call these file >from the directory? Did you ever get the help you sought? My guess is that readers found your question...

read file in tcl
how to read or call a file in tcl ? davidw@dedasys.com (David N. Welton) wrote in message news:<873cg837s7.fsf@dedasys.com>... > prowarcraftplayer@yahoo.com (K Zewi) writes: > > > how to read or call a file in tcl ? > > 'call' a file? > > Reading a file can be done with the 'read' command: > > set fl [open "somefile"] > set data [read $fl] > > is a simple way to do it. You want to look at the documents for those > commands, and maybe 'fconfigure' if you want to read a binary file. i still can't read ...

Read block of file in Tcl
Hi, I have an input file in the following format: ******************************** Name1 Name2 Row1 DEF 001 Row2 ABC DEG 003 Row3 EW EW 002 Row4 FF 0012 Row1 ADEF 1001 Row2 ARBC DEG 2003 Row3 EWW EW 0302 Row4 AB 0112 Name1 Name2 Row1 DSDEF 001 Row2 ABVC DEG 003 Row3 EDW EW 002 Row4 FVF 0012 Row1 AF 1001 Row2 ACRBC DEG 2003 Row3 ESWW EW 0302 Row4 AEB 0112 **************************************** I have to read this file and --> if I get "Name1" in any of the line, then I have to read the block of file from "Name1" to the first occurrance of "Row4". --> I...

read an XML file in TCL
Hello I am looking to read an XML file into my TCL program and extract information. How do we read an XML file in TCL? Are there man pages that describe these? Thanks krithiga one way is: http://wiki.tcl.tk/tdom another (and faster, but should be used only for valid stuff) is http://wiki.tcl.tk/11020 Torsten Edler wrote: > another (and faster, but should be used only for valid stuff) is > I'm curious as to this assertion that the shallow regexp parser is faster than tdom, I would have expected things to be the other way around. Do you have a benchmark? Were you testing tdom building a DOM tree or just SAX parsing (the latter would be a fairer comparison)? My own brief benchmark (parsing the XML 1.0 spec, ~200KB) produced these results: proc ParseXMLRegexp xml { XML::Init $xml while 1 { lassign [XML::NextToken] type val attr etype if {$type eq "EOF"} { break } } } proc ParseXMLTdom xml { dom parse $xml doc } puts "Regexp: [time { ParseXMLRegexp $xml } 10]" puts "Tdom: [time { ParseXMLTdom $xml } 10]" output: Regexp: 2419835.7 microseconds per iteration Tdom: 52872.1 microseconds per iteration which makes tdom roughly 45X faster than the regular expression parser, and that's with tdom building and destroying a full DOM tree. -- Neil Hi Neil, i typed my answer a bit too fast and mixed up TclXML with TcLDOM. Few months ago i had to read and extract all data from an XML-...

Dose there any tcl script to translate an file with embedded tcl
Hi I need to generate some big file, but there are rules for generate these files Ex . ============================== Start input a [0] wire input a [1] wire .. .. .. .. input a [1000] wire End ================================= Dose there any tcl script can help to translate a file with embedded tcl script into a new file For example this is a source file ======================== Start * set i 0 * for { set i 0 } { $i < 1000 } { incr i } { * puts input a [$i] wire * } End ========================== After Translate ======================= Start input a [0] wire input a [1] wire .. .. ...

Using TCL files in Python ?
I am reasonably new to programming in Python. [Using LINUX] Up until now I have been using GUI widgets supplied by 'Tkinter' but starting to realise that Tkinter have limited widgets. I have been given the lead that I should look at other sources for GUI widgets - namely TCL. I have just done a search for 'tcl' files on my 'Fedora 3' installation and find I have available: Tix8.1 Tcl8.4 Tk8.4 I have never used TCL code under Python so I assume I can use widgets from any of these providers ? Where is a good resource I can use to help understand how to use TCL...

tcl-gaul: Genetic Algorithms for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-gaul Tcl-gaul is a Tcl extension for genetic/evolutionary algorithm processing.It relies on the GAUL library: http://gaul.sourceforge.net/ * A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems. Genetic algorithms are categorized as global search heuristics. They are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover. For an introduction to genetic algorithms visit: http://gaul.sourceforge.net/intro.html Platform: Linux (GAUL library dependency) Home page: http://sourceforge.net/projects/tcl-gaul/ Man page: http://tcl-gaul.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

In Tcl and C++ code, how to use Tcl Command, such as exit?
In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control all input and output from Tcl, but i want to use some of Tcl' Commands, such as, exit. I used Tcl_Eval() then, but the Tcl command seem invisible in my code, I typed a string in command prompt, such as "AAAAA", and Enter, got nothing feedback. How can i do to get these Tcl Commands work? Thanx! vian1381@china.com.cn wrote: > In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control > all input and output from Tcl, but i want to use some of Tcl' Commands, > such as, exit. > > I used Tcl_Eval() then, but the Tcl command seem invisible in my code, > I typed a string in command prompt, such as "AAAAA", and Enter, got > nothing feedback. Your questions are hard to understand, but they suggest that you believe that setting a custom stdin channel will do some magic to establsh a prompt/read/eval loop. That is not the case. > How can i do to get these Tcl Commands work? Start with something that works, like the source code for tclsh, and adapt to your needs. Or post a followup and include more code examples to explain what you're doing and how it doesn't do what you expect. -- | Don Porter Mathematical and Computational Sciences Division | | donald.porter@nist.gov Information Technology Laboratory | | http://math.nist.gov/~DPorter/ NIST | |_____________________________________...

Tcl+incr Tcl debuggers to use on command line?
Hi, Does anyone know of incr Tcl supported debuggers that work on command line? That is, without needing bundling with IDEs? Thanks On 10/11/14, 9:46 PM, kenneth.bull@gmail.com wrote: > Hi, > > Does anyone know of incr Tcl supported debuggers that work on command line? > That is, without needing bundling with IDEs? Well, the debugger in ActiveState's TDK does not need a bundled IDE and it works with [incr Tcl] -- but it is a GUI application not a command line one. -- +------------------------------------------------------------------------+ | Gerald W. L...

tcl code to read an image and write tcl code?
Does anyone know where I can find a tcl proc that would take an image, say a gif, and output pure tcl code that I could paste into a program? I saw something about a unix program that did something with mimes but I'm on windows. In article <4403BC94.447A7341@rocketship1.com>, Eric Taylor <et2@rocketship1.com> wrote: > > >Does anyone know where I can find a tcl proc >that would take an image, say a gif, and output >pure tcl code that I could paste into a program? > >I saw something about a unix program that did >something with mimes but I'm on windows. > > I think TkProE (http://tkproe.sourceforge.net) can do this. A quick look suggests that the procs TP_ImageToData & TP_ImageEncode might do what you want. Ted Eric Taylor wrote: > Does anyone know where I can find a tcl proc > that would take an image, say a gif, and output > pure tcl code that I could paste into a program? > > I saw something about a unix program that did > something with mimes but I'm on windows. > > Something like this ought to be pretty close (untested, but I think it's pretty close). It requires the base64 package from tcllib: package require base64 proc main {} { global argv set file [lindex $argv 0] set fd [open $file r] set rawdata [read $fd] close $fd set b64data [base64::encode $rawdata] puts "image create photo -data {\n$b64data\n}" } mai...

Will tcl 9 use epoll or kqueue for tcl?
curious http://luvit.io/ also check this out for web stuff done in lua but perhaps tcl can steal nice ideas On Wednesday, January 2, 2013 3:22:02 PM UTC-8, gavino_himself wrote: > curious > > > > http://luvit.io/ also check this out for web stuff done in lua but perhaps tcl can steal nice ideas cherokee uses them so gota be ast for events and cherokee outperforms nginx ...

tcl-pam: PAM authentication for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-pam Tcl-pam is a Tcl interface to the PAM* service of Linux. It provides a Tcl package that allows Tcl scripts to use PAM to authenticate users and programs. It relies on linux-pam library: http://www.kernel.org/pub/linux/libs/pam/ * PAM (Pluggable Authentication Modules): A mechanism to integrate multiple low−level authentication schemes into a high−level application programming interface (API). This enables programs that rely on authentication to be written independently of the underlying authentication scheme. Platform: Linux Home page: http://sourceforge.net/projects/tcl-pam/ Man page: http://tcl-pam.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Reading a tcl file in C
I have a tcl configure file (a list of variables with values and comments) that I wish to read into an array in C (or better yet, Objective-C). Does anyone have any suggestions of how to do this, or have any public-domain or GPL code that does this? randall.h.wood@gmail.com wrote: > I have a tcl configure file (a list of variables with values and > comments) that I wish to read into an array in C (or better yet, > Objective-C). Does anyone have any suggestions of how to do this, or > have any public-domain or GPL code that does this? Can you give us a short example of what this file will look like? -- +--------------------------------+---------------------------------------+ | Gerald W. Lester | |"The man who fights for his ideals is the man who is alive." - Cervantes| +------------------------------------------------------------------------+ On Mar 13, 9:02 am, "Gerald W. Lester" <Gerald.Les...@cox.net> wrote: > randall.h.w...@gmail.com wrote: > > I have a tcl configure file (a list of variables with values and > > comments) that I wish to read into an array in C (or better yet, > > Objective-C). Does anyone have any suggestions of how to do this, or > > have any public-domain or GPL code that does this? > > Can you give us a short example of what this file will look like? > I apologize for the delayed response. EXAMPLE FOLLOWS: # Set the dire...

How to open a logical partition and read all of its file using windows function ReadFile() ? Question How to open a logical partition and read all of its file using windows function ReadFile() ?
Hii In my application , wanna copy all files from one partition to another partition. First I copied a file that I taken default and copied to another partition. The above operation is done by using the control code "FSCTL_GET_RETRIEVAL_POINTERS". The clusters used are read and wrote into destination volume using readfile() and writefile() windows functions. Now I gotta copy all files..... So how to proceed ....?? Thanking you. On Sat, 13 Jun 2009 09:37:42 -0700 (PDT), krish <krishnampkkm@gmail.com> wrote: >Hii > >In my applicatio...

tcl-mmap: A POSIX mmap interface for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mmap Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides a Tcl package that allows Tcl scripts to: 1) Memory map files for improved access efficiency; 2) Share memory between related processes; 3) Easily implement cyclic persistent log files. * See the mmap(2) man page. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-mmap/ Man page: http://tcl-mmap.sourceforge.net/ Author: Alexandros Stergiakis On Sep 3, 11:48=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl project: tcl-mmap > > Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides > a Tcl package that allows Tcl scripts to: 1) Memory map files for > improved access efficiency; 2) Share memory between related processes; > 3) Easily implement cyclic persistent log files. > > * See the mmap(2) man page. > Great to see this and the other packages you made. Looking at the manpage it looks a bit misformatted before the usage example. Any specific reason to use GPL for this instead the usual Tcl/MIT/BSD style license used? Michael schlenk wrote: > On Sep 3, 11:48 am, Alexandros Stergiakis <alst...@gmail.com> wrote: >> This is an announcement for a relatively new Tcl project: tcl-mmap >> >> Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides >> a Tcl package that...

tcl-syslog: Unix system logging for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-syslog Tcl-syslog is a Tcl interface to the *nix syslog service. It provides a Tcl package that allows Tcl scripts to log messages to syslog. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-syslog/ Man page: http://tcl-syslog.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-mq: POSIX Message Queues for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mp Tcl-mp is a Tcl interface to POSIX Message Queues*. It provides a Tcl package that allows scripts to create/open/close/unlink multiple parallel message queues, and to send/receive messages synchronously and asynchronously to/from them. * A POSIX message queue is an Inter-Process Communication mechanism available on Linux and some other POSIX-compliant operating systems. It allows to or more processes (or threads) to communicate under the same OS. The messages are buffered by the kernel, which gives them kernel persistency. A message queue can be thought of as a linked list of messages. Threads with adequate permission can put messages onto the queue, and threads with adequuate permission can remove messages from the queue. Each message is assigned a priority by the sender, and the oldest message of highest priority is always retrieved first. Unlike PIPES and FIFOS, no requirement exists that someone be waiting for a message to arrive on a queue, before some process writes a message to that queue. It's not even a requirement for both processes to exist at the same time. Read mq_overview(7) for more details Platform: Linux Home page: http://sourceforge.net/projects/tcl-mp/ Man page: http://tcl-mp.sourceforge.net/ Author: Alexandros Stergiakis alsterg On Sep 3, 11:37=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl pro...

Tcl library for reading ELF files ?
Does anybody know wheather there is a Tcl library available for reading ELF files ? Thanks, Rolf. --------------------------------------------------------------- Rolf Schroedter, German Aerospace Center Remove .nospam to reply: mailto:Rolf.Schroedter@dlr.de.nospam ...

TCL file reading enhancement idea
Earlier today I read a post where someone was having a problem getting 'tail' to work for reading a file. I also have a need to just read the end of file but I am trying to stay from exec OS APIs in my application and just stay with pure TCL. After thinking about this it occurred to me that a useful addition to TCL would be an implementation of 'tail' that would return some configurable value of lines (for example, the last 5 lines) from the end of a file. I have tried reading the whole file just to check for some data at the end. This works fine for small files but for larg...

Web resources about - How to read a file using TCL - comp.lang.tcl

Kids React To Donald Trump
It's safe to say Donald Trump is one of the most polarizing figures in the world of politics today, drawing comparisons to Hitler, Stalin and ...

26-year-old man arrested in connection with Iditarod crashes
KRON4.com 26-year-old man arrested in connection with Iditarod crashes KRON4.com This undated photo provided by Husky Homestead shows Nash, ...

Two people killed in ultralight plane crash in Yarrawonga
Two people have been killed in an ultralight plane crash in the state's far north.

Nickelodeon’s 2016 Kids’ Choice Awards
Show host Blake Shelton is ‘slimed’ during Nickelodeon’s 2016 Kids’ Choice Awards in Inglewood, California. — Reuters pic

Google AlphaGo AI loses 4th match against champion, still winning 3-1
AlphaGo, the artificial intelligence from Google's DeepMind project, has finally had its winning streak against Go world champion Lee Sedol broken. ...

Daylight Saving Time
Tech Times Daylight Saving Time - Is It An Idea Whose Time Is Past? Tech Times Daylight saving time means most Americans recently set their ...

Officials say unrest at prison in Alabama leaves 2 hurt
Inmates set a fire, seized control of a dormitory and stabbed two corrections officials during a violent uprising at a prison in southern Alabama, ...

Germanwings Crash Report: Investigators Urge Better Reporting After Doctor Refused To Divulge Pilot’s ...
A Germanwings crash report has revealed that doctors who treated Germanwings pilot Andreas Lubitz for depression and mental illness before he ...

Solar EV Charging Station Built By High School Students
Originally published on Sustainnovate. By Henry Lindon A working solar electric vehicle charging station was recently built by a team of students ...

Unusually widespread flooding across Louisiana, Mississippi
HATTIESBURG, Miss. (AP) — As the Leaf River rose north of Hattiesburg, Mississippi, 26-year-old Rebecca Bruce and her fiancé grabbed what they ...

Resources last updated: 3/13/2016 2:22:25 PM