[Gambas-user] stat bug?

paulwheeler paulwheeler at ...546...
Mon May 6 17:00:30 CEST 2013


   I have many files with spaces in the name. However, this causes the message
   "File or directory does not exist" when using stat. Works fine for files
   that do not have spaces in the name. I even tried adding quotes to the
   string, but still get same message.
   Using Gambas 3.4.1 on this system:
   [System]
   OperatingSystem=Linux
   Kernel=3.8.0-19-generic
   Architecture=x86_64
   Distribution=Ubuntu 13.04
   Desktop=XFCE
   Theme=QGtk
   Language=en_US.UTF-8
   Memory=7860M
   [Libraries]
   GStreamer=libgstreamer-0.10.so.0.30.0
   GTK+=libgtk-x11-2.0.so.0.2400.17
   Qt4=libQtCore.so.4.8.4
   SDL=libSDL-1.2.so.0.11.4
   Poppler=libpoppler.so.28.0.0
   Public Sub Button1_Click()
     Dim txtSelectedPath As String
     FileChooser1.Filter = ["*.txt", "Text Files", "*", "All files"]
     FileChooser1.Dir = User.Home
     Print InStr(FileChooser1.SelectedPath, " ")

     If InStr(FileChooser1.SelectedPath, " ") <> 0 Then
             Print "inside instr <> 0"
        txtSelectedPath = Quote$(FileChooser1.SelectedPath)
       ' Print txtSelectedPath
      Else
          Print "inside instr else"
        txtSelectedPath = FileChooser1.SelectedPath
     Endif
    Print txtSelectedPath

     With Stat("/home/paul/Gospel Art Kit 1-tif.odt")
    ' With Stat(txtSelectedPath)
       ListBox1.Add(.Size)
       ListBox1.Add(.LastModified)
       ListBox1.Add(.Path)
       ListBox1.Add(.User)
       Print "done with stat"
     End With
   End



More information about the User mailing list