This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

this code for windows

Old posts that have not been replied to for several years.
Locked
I
Idezo
Voice
Posts: 1
Joined: Sat Apr 30, 2005 10:38 pm

this code for windows

Post by Idezo »

hello

I have this in a tcl script:

switch $machtype {
"linux" { set newsfile [open "| tail -n $npcl news_$chan.txt" "r+"] }
"solaris" { set newsfile [open "| tail -$npcl news_$chan.txt" "r+"] }
}

But what is it for windows?
Can some one help me with this?
D
Dizzle
Op
Posts: 109
Joined: Thu Apr 28, 2005 11:21 am
Contact:

Post by Dizzle »

dont know if anyone know's how too script windows, this is a TCL scripting forum
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

you can't directly use open or exec with windrop, at least its not known to me.
however, there is a possible workaround: http://forum.egghelp.org/viewtopic.php?t=9376
Note: its a workaround, not a solution!
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
G
Galadhrim
Op
Posts: 123
Joined: Fri Apr 11, 2003 8:38 am
Location: Netherlands, Enschede

Post by Galadhrim »

try "win" or "win32". It should be the same as linux exept for the dir separator "/" that is "\".
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

theoretically he could use the linux variant (refer:)

Code: Select all

C:\Dokumente und Einstellungen\De Kus>tail --help
Usage: tail [OPTION]... [FILE]...
Print the last 10 lines of each FILE to standard output.
With more than one FILE, precede each with a header giving the file name.
With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
      --retry              keep trying to open a file even if it is
                           inaccessible when tail starts or if it becomes
                           inaccessible later; useful when following by name,
                           i.e., with --follow=name
  -c, --bytes=N            output the last N bytes
  -f, --follow[={name|descriptor}]
                           output appended data as the file grows;
                           -f, --follow, and --follow=descriptor are
                           equivalent
  -F                       same as --follow=name --retry
  -n, --lines=N            output the last N lines, instead of the last 10
      --max-unchanged-stats=N
                           with --follow=name, reopen a FILE which has not
                           changed size after N (default 5) iterations
                           to see if it has been unlinked or renamed
                           (this is the usual case of rotated log files)
      --pid=PID            with -f, terminate after process ID, PID dies
  -q, --quiet, --silent    never output headers giving file names
  -s, --sleep-interval=S   with -f, sleep for approximately S seconds
                           (default 1.0) between iterations.
  -v, --verbose            always output headers giving file names
      --help     display this help and exit
      --version  output version information and exit

If the first character of N (the number of bytes or lines) is a `+',
print beginning with the Nth item from the start of each file, otherwise,
print the last N items in the file.  N may have a multiplier suffix:
b 512, k 1024, m 1024*1024.

With --follow (-f), tail defaults to following the file descriptor, which
means that even if a tail'ed file is renamed, tail will continue to track
its end.  This default behavior is not desirable when you really want to
track the actual name of the file, not the file descriptor (e.g., log
rotation).  Use --follow=name in that case.  That causes tail to track the
named file by reopening it periodically to see if it has been removed and
recreated by some other program.

Report bugs to <bug-coreutils@gnu.org>.
This would require following:
- Cygwin is installed
- Cygwin /bin directory is in windows "path" variable
- Eggdrop would be able to use TCL exec or open on Cygwin

so even if you fullfill the first 2 steps (the second steop could of course be replaced with giving a full path to tail.exe), you will still have to get around this smal bug. This no TCL bug, this is just a bug with Eggdrop under Cygwin (it however could be related to specific TCL versions, but there are not many TCL builds avaible to be used with Eggdrop under win32).
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked