[bcn-pm] Comprovar el contingut d'un fitxer en el debugger

avilella avilella at lycos.es
Thu Apr 15 13:02:53 CDT 2004


Hola a tothom,

estava fent un script que escrivia unes línies en un fitxer de sortida,
i m'he adonat que m'aniria bé tenir controlat el que s'escriu en aquest
fitxer mentre passa pel debugger:

(1) open $outfile, "+>myfile.txt"
        #open the file for read/write access with "+>" mode.
(1b)print $outfile "print something somewhere else in the code that you
can't or don't find easy to trace"
(2) seek($outfile,-100,2)
        #for placing the pointer to the 100 character to the EOF
(3) read $outfile, $string, 100
        #for reading the last 100 characters and pushing them to $string
(4) x $string

(2,3 i 4) en la consola del debugger.

Volia comentar-ho a la llista per si algú troba alguna manera més curta
o més fàcil de fer-ho...

Atentament,

    Albert.






More information about the Barcelona-pm mailing list