Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   API de Windows (https://www.clubdelphi.com/foros/forumdisplay.php?f=7)
-   -   Error en copyfile (https://www.clubdelphi.com/foros/showthread.php?t=76129)

toni.vi 10-10-2011 23:24:10

Error en copyfile
 
Desde hace unos dias y en una máquina en particular, no me deja copiar los ficheros y me da el attributo 8208, en el codigo delphi
Código Delphi [-]
procedure CopyDirectory(Origen, Desti : string);
var
 Files : integer;
 FOrigen, FDesti : string;
 ok : boolean;
 Search : TSearchRec;
 Attrib : Integer;
begin
 Files := FindFirst(Origen + '\*.*', faAnyFile, Search);
 while Files = 0 do
 begin
  if (Search.Attr <> faDirectory) then
  begin

     FOrigen := Origen + '\' + Search.Name;
     FDesti := Desti + '\' + Search.Name;

     ok := CopyFile(PChar(FOrigen),PChar(FDesti),false);
     if ok then
     begin
       Form1Copia.ProRegistroCopia       (FOrigen, FDesti, '1');
     end else
     begin
       if (Search.Name <> '.') and (Search.Name <> '..') then
       begin
//aqui es donde el search.attr tiene el valor 8208, y no me ha dejado copiar el fichero.
//---------------------------------------------------------------------------------
         ProRegistroCopiaErrores(FOrigen, FDesti, '3', Search.Attr);
       end;
     end;
  end;
end;

Desde otro ordenador la copia va perfecta, y lleva funcionando desde hace un par 2 años.
Alguna idea, o alguna lista de que significa este valor de 8208.
Gracias.

ecfisa 11-10-2011 00:29:55

Hola Toni.vi.

Cita:

FILE_ATTRIBUTE_READONLY = 1
FILE_ATTRIBUTE_HIDDEN = 2
FILE_ATTRIBUTE_SYSTEM = 4
FILE_ATTRIBUTE_DIRECTORY = 16
FILE_ATTRIBUTE_ARCHIVE = 32
FILE_ATTRIBUTE_ENCRYPTED = 64
FILE_ATTRIBUTE_NORMAL = 128
FILE_ATTRIBUTE_TEMPORARY = 256
FILE_ATTRIBUTE_SPARSE_FILE = 512
FILE_ATTRIBUTE_REPARSE_POINT = 1024
FILE_ATTRIBUTE_COMPRESSED = 2048
FILE_ATTRIBUTE_OFFLINE = 4096
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192
El atributo 8208 se corresponde con (8192+16) es decir: FILE_ATTRIBUTE_NOT_CONTENT_INDEXED + FILE_ATTRIBUTE_DIRECTORY.

Un saludo.

toni.vi 11-10-2011 09:34:40

Muchas gracias.
Parece que este SO no debe estar muy fino.
De todas maneras si haces un copiar y pegar funciona bien.
Solo me ocurre con el copyfile.


La franja horaria es GMT +2. Ahora son las 06:03:19.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi