Code: Select all
set message_db "data/h_message.dat"
When i created the file manually by, mkdir data,
touch data/h_message.dat
Then added the line as below in uzeno.tcl to see if the script could read and continue, in h_message.dat.
It is as the script is able to READ from the file but unable to write to/create the file.Hadace !messaging database file created
it is not a write rights problem, i even made the file when creating it, rwxrwxrwx just to make shure.
I was to join in on #hadace today, to test a debug version of his script that he was gonna make, but i got RL (workrelated) hindrances.
Bseen is my personal favourite, well havent tried much nor have i needed to try any other seen scripts.
Has all the functions needed and supports wildcard searches on nicknames and such.
It states a database file also just as uzeno.tcl does.
named bs_data.<channame>
In which it stores and sort its data.
It uses this method to create the file.
Code: Select all
proc bs_save {} {
global bs_list userfile bs ; if {[array size bs_list] == 0} {return}
if {![string match */* $userfile]} {set name [lindex [split $userfile .] 0]} {
set temp [split $userfile /] ; set temp [lindex $temp [expr [llength $temp]-1]] ; set name [lindex [split $temp .] 0]
}
if {[file exists $bs(path)bs_data.$name]} {catch {exec cp -f $bs(path)bs_data.$name $bs(path)bs_data.$name.bak}}
set fd [open $bs(path)bs_data.$name w] ; set id [array startsearch bs_list] ; putlog "Backing up seen data..."
puts $fd "#$bs(updater)"
while {[array anymore bs_list $id]} {set item [array nextelement bs_list $id] ; puts $fd "$bs_list($item)"} ; array donesearch bs_list $id ; close $fd
}
Code: Select all
proc mess_write { nick cimzett uzenet } {
global message_db
set cimzett [string tolower $cimzett]
if {![file exists $message_db]} {
file mkdir [lindex [split $message_db /] 0]
set filemuvelet [open $message_db w+]
puts $filemuvelet "Hadace !messaging database file created"
} else {
set filemuvelet [open $message_db a]
}
set systemTime [clock seconds]
set ido [clock format $systemTime -format {%d.%m.%Y. %H.%M:}]
puts $filemuvelet "$nick $cimzett $ido [join $uzenet] "
close $filemuvelet
}
Code: Select all
This command opens a file, serial port, or command pipeline and returns a channel identifier that may be used in future invocations of commands like read, puts, and close. If the first character of fileName is not | then the command opens a file: fileName gives the name of the file to open, and it must conform to the conventions described in the filename manual entry.
The access argument, if present, indicates the way in which the file (or command pipeline) is to be accessed. In the first form access may have any of the following values:
r
Open the file for reading only; the file must already exist. This is the default value if access is not specified.
r+
Open the file for both reading and writing; the file must already exist.
w
Open the file for writing only. Truncate it if it exists. If it doesn't exist, create a new file.
w+
Open the file for reading and writing. Truncate it if it exists. If it doesn't exist, create a new file.
a
Open the file for writing only. If the file doesn't exist, create a new empty file. Set the initial access position to the end of the file.
a+
Open the file for reading and writing. If the file doesn't exist, create a new empty file. Set the initial access position to the end of the file.