#!/mod/bin/jimsh

package require cgi
source /mod/webif/lib/setup
require ts.class

httpheader

set file [cgi_get file]
set bookmarks [cgi_get bookmarks ""]

if {[system inuse $file]} {
	puts "This file is in use. Cannot process at the moment."
	exit
}

set ts [ts fetch_or_error $file]
if {$ts != 0} {
	$ts setbookmarks [split [string trim $bookmarks]]
	puts "Bookmarks saved successfully."
}
