[ROOT] Pb with TSystem::GetPathInfo

From: dumontei (edumonteil@cea.fr)
Date: Sun Jun 08 2003 - 18:46:41 MEST


Hello,

I am trying to extract the modification time of a text file, pico.txt,
under root Cint.
When I use the method  GetPathInfo of TSystem, the parameters values of
the method seem to be not stored, even if the file is recognized
(GetPathInfo is set to 0).
When putting the trace mode on, the problem seems to come from the file
declaration.



  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   3.03/09       2 June 2003   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.56, Sep 4 2002
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] Long_t *id,*size,*flags,*mt;
root [1] gSystem->GetPathInfo("/pathname/pico.txt",id,size,flags,mt)
(int)0
root [2] id
(Long_t*)0x0
root [3] size
(Long_t*)0x0
root [4] flags
(Long_t*)0x0
root [5] mt
(Long_t*)0x0
root [6] .T

Trace mode on 1
root [7] mt
{mt;
2    }
# _iostream
63   G__ateval(long* const & x) {return(0);}

(Long_t*)0x0



I get the same problem if I write a macro using /sys/stat librarie and
trying to assign the buffer value myself:

#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include "Riostream.h"
#include <stdlib.h>

void analy()
{
  struct stat buf;
   ifstream in;
   in.open("pico.txt", ios::in);
   stat(in, &buf);
    printf ("proprietaire %d, taille %d\n", buf.st_uid, buf.st_size);
}



Am I doing something wrong?

Thanks a lot in advance,

Eric





This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET