[Gambas-user] COPY does not always copy chgrp and chown

Rolf-Werner Eilert eilert-sprachen at ...221...
Fri Aug 7 10:54:36 CEST 2009


Just found this (Gambas 2 project) when copying several students from 
one class into another. For each student, there are about 6 files to be 
copied from one directory into another. The first one will always get 
standard chgrp and chown of the application's user. The other files 
SOMETIMES are copied with correct group and ownership, MOSTLY not.

All files have special group and ownership, controlling if teachers or 
only the office can access the data.

Now, this is the function that does the actual copy:



'kopiert alle Dateien eines Namens in eine andere Kartei
'- ziel ist der Zielpfad
'- wenn eine gleichnamige Datei schon vorhanden ist, kommt "-1" zurück
'- wenn es geklappt hat, kommt "0" zurück

'wird z. B. von dlgNamenKopieren benutzt

PUBLIC FUNCTION NamenKopieren(schlyssel AS String, ziel AS String) AS 
Integer
DIM original AS String
DIM odatei AS String
DIM opfad AS String
DIM datei AS String

   original = getFilename(schlyssel)

   odatei = file.BaseName(original)
   opfad = file.Dir(original)

   IF Exist(ziel &/ odatei & ".felder") THEN
     RETURN -1
   END IF

   FOR EACH datei IN Dir(opfad, odatei & ".*")
     COPY opfad &/ datei TO ziel &/ datei
   NEXT

   RETURN 0

END


Do you see anything wrong here? As it sometimes works correctly I would 
actually think that it's a bug in copy.

The filesystem is ext3.

Regards

Rolf




More information about the User mailing list