;; windows helpers ;; Antti Pietikäinen (heidel@operamail.com) ;; 2005 ;; dir command ;; ouput dir to file, quote file, (remove file) ;; thank you microsoft for sucking ;; file not removed, caused access failure or something ;; (somehow managed to delete the file before quote, causing ;; windows to leave a 0-byte file with permanent access denied) /def -i dir=\ /sh dir %{*}> %{TEMP}\\tfdir.tmp%;\ /let tempfile=$[strcat(replace("\\","\\\\",{TEMP}),"\\\\tfdir.tmp")]%;\ /quote -S /echo - '"%{tempfile}" ;; start, useful for file editing /def -i start=\ /sh start %{*} ;; create a file /def -i create=\ /if ({#} != 1) \ /break%;\ /endif%;\ /test tfclose( tfopen({1},"a") )%;\ /if ( substr({1},-3) =~ ".tf" ) \ /start %{1}%;\ /endif ;; add a line to notes.txt, or show the notes /def -i note=\ /if ({#}==0) \ /echo -aB NOTES:%;\ /quote -S /echo - '"notes.txt"%;\ /echo -aB =====%;\ /return%;\ /else \ /let filehandle=$[tfopen("notes.txt","a")]%;\ /if (filehandle != -1) \ /test tfwrite(filehandle,{*})%;\ /echo % Note added: %{*}%;\ /test tfclose(filehandle)%;\ /endif%;\ /endif ;; .... /def -i expl=/sh explorer %{*}