Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #9  
Antiguo 31-08-2010
Avatar de escafandra
[escafandra] escafandra is offline
Miembro Premium
 
Registrado: nov 2007
Posts: 2.211
Poder: 22
escafandra Tiene un aura espectacularescafandra Tiene un aura espectacular
Código Delphi [-]
function SetFileSize(FileName: String; Size: int64): boolean;
var
  Hi: DWORD;
  Attributes: DWORD;
  hFile: THandle;
  R: integer;
begin
  Hi:= DWORD(Size shr 32);
  Result:= false;
  Attributes:= GetFileAttributes(PCHAR(FileName));
  if(Attributes = DWORD(-1)) then Attributes:= FILE_ATTRIBUTE_NORMAL;
  SetFileAttributes(PCHAR(FileName), FILE_ATTRIBUTE_NORMAL);
  hFile:= CreateFile(PCHAR(FileName), GENERIC_WRITE, 0, nil, OPEN_ALWAYS, FILE_FLAG_WRITE_THROUGH, 0);
  if hFile <> THandle(-1) then
  begin
    if SetFilePointer(hFile, DWORD(Size), @Hi, FILE_BEGIN) <> DWORD(-1) then
    begin
      Result:= SetEndOfFile(hFile);
    end;
    CloseHandle(hFile);
  end;
  SetFileAttributes(PCHAR(FileName), Attributes);
end;


Saludos.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
como saber el tamaño de un fichero kenychy C++ Builder 13 19-11-2010 16:46:59
¿Cómo puedo saber el tamaño que debo asignar al buffer? MON___ API de Windows 5 02-02-2008 22:08:02
Como controlar el tamaño de un fichero subido al servidor lazar PHP 7 06-03-2007 01:27:22
Como asignar el tamaño de papel en QuickRep?? AndGaG Impresión 2 02-07-2006 21:51:12
Obtener Todo El Registro De Una Tabla Aunque Aunque Este Agrupado Por 2 Campos agova SQL 6 11-08-2004 15:48:14


La franja horaria es GMT +2. Ahora son las 01:37:04.


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