Añadida a la sección Descargas la aplicación AjpdSoft Modificar fechas de fichero: permite modificar las fechas y horas de modificación, creación y último acceso de un fichero. La aplicación permite drag and drop (arrastrar y soltar), es suficiente con arrastrar y soltar un fichero y mostrará la fecha actual de creación, de modificación y de último acceso y permitirá cambiarlas. Liberamos el código fuente - source code en Borland Delphi 6 100% Open Source.
Características más importantes de AjpdSoft Modificar fechas de fichero
-
Aplicación de muy sencillo manejo, muy fácil e intuitiva, todas las opciones están en una misma ventana.
-
La aplicación ha sido desarrollada en el lenguaje de programación Borland Delphi 6.
-
No necesita instalación, es suficiente con ejecutar el fichero cambiarFechaFichero.exe.
-
Permite arrastrar y soltar (drag and drop) para seleccionar el fichero.
-
Modifica la fecha de creación, de modificación y de último acceso.
-
Muestra las fechas actuales de creación, de modificación y de último acceso de un fichero.
AjpdSoft Modificar fechas de fichero en funcionamiento
AjpdSoft Modificar fechas de fichero permite seleccionar un fichero para mostrar la fecha y hora de creación, de modificación y de último acceso. También permite modificarlas para que el usuario seleccione las que desee. La aplicación modificará dichas fechas para que queden guardadas en el fichero.
Para modificar la fecha de creación de un fichero, en primer lugar lo seleccionaremos pulsando el botón "..." o bien escribiendo la ruta y el nombre (o arrastrándolo y soltándolo en la aplicación):

Seleccionaremos el fichero a modificar la fecha de creación:

Marcaremos en "Fecha a modificar" la opción "Fecha de creación". En "Nueva fecha y hora" seleccionaremos la fecha y la hora que quedarán guardadas en el fichero como la fecha y la hora de modificación:

Pulsaremos "Aplicar fecha" para guardar los cambios en el fichero:

De la misma forma, podremos modificar la fecha y hora de modificación del fichero y la de último acceso. Aunque esta última fecha no quedará modificada, pues como fecha de último acceso quedará la del día y hora en que se modifique.
Instalación y configuración de AjpdSoft Modificar fechas de fichero
Podéis descargar el programa con el código fuente (freeware, gratuito) desde esta URL:
Descarga gratuita (freeware) de AjpdSoft Modificar fechas de fichero
Para el correcto funcionamiento sólo es necesario el fichero cambiarFechaFichero.exe, el resto de ficheros corresponden al código fuente y no son necesarios para su ejecución.
La aplicación no necesita instalación de ningún tipo, el ficherocambiarFechaFichero.exe se puede ejecutar directamente.
Datos técnicos de AjpdSoft Modificar fechas de fichero
Esta aplicación ha sido desarrollada en el lenguaje de programación Borland Delphi 6.
Si eres desarrollador de software y te has registrado en nuestra web (si aún no te has registrado puedes hacerlo desde aquí gratuitamente) puedes descargar el código fuente 100% Open Source (completo y totalmente gratuito) en Borland (ahora Codegear) Delphi 6:
AjpdSoft Modificar fechas de fichero (Código fuente Open Source en Borland Delphi 6)
AjpdSoft Modificar fechas de fichero ha sido testeada y funciona correctamente en equipos con sistemas operativos: Windows 98, Windows XP, Windows 2000 Server, Windows Server 2003, Windows Vista y Windows Seven (7).
A quién va dirigida AjpdSoft Modificar fechas de fichero
La aplicación va dirigida a administradores de sistemas y usuarios que deseen, por algún motivo, cambiar la fecha de un fichero (tanto la de creación como la de modificación).
También puede ser útil para estudiantes que tengan que realizar algún proyecto de ejemplo de modificación de datos de un fichero con Delphi.
Anexo
- Código fuente (source code) de la aplicación completa:
Unidad "UnidadMenuPrincipal.pas":
unit UnidadMenuPrincipal;
{$R WinXP.res}
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DateUtils, Buttons, StdCtrls, ComCtrls, ExtCtrls, shellapi, ThemeMgr;
type
TformMenuPrincipal = class(TForm)
opTipoFecha: TRadioGroup;
GroupBox1: TGroupBox;
txtFecha: TDateTimePicker;
txtHora: TDateTimePicker;
GroupBox2: TGroupBox;
dlAbrir: TOpenDialog;
bModificarFecha: TBitBtn;
bSeleccionarFichero: TBitBtn;
txtFichero: TEdit;
lfCreacion: TLabel;
lfModificacion: TLabel;
lfUltimoAcceso: TLabel;
LWEB: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Shape1: TShape;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
StatusBar1: TStatusBar;
ThemeManager1: TThemeManager;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Shape7: TShape;
procedure bModificarFechaClick(Sender: TObject);
procedure bSeleccionarFicheroClick(Sender: TObject);
procedure obtenerDatosFichero;
procedure LWEBClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
//para arrastrar y soltar
procedure SoltarFichero (var Msg: TWMDropFiles); message WM_DROPFILES;
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
formMenuPrincipal: TformMenuPrincipal;
implementation
uses UnidadUtilidadFechas;
{$R *.dfm}
procedure TformMenuPrincipal.SoltarFichero (var Msg : TWMDropFiles);
var
CFileName: array[0..MAX_PATH] of Char;
begin
try
if DragQueryFile(Msg.Drop, 0, CFileName, MAX_PATH) > 0 then
begin
txtFichero.Text := CFileName;
obtenerDatosFichero;
Msg.Result := 0;
end;
finally
DragFinish(Msg.Drop); //finaliza arrastrar y soltar
end;
end;
procedure TformMenuPrincipal.bSeleccionarFicheroClick(Sender: TObject);
begin
if dlAbrir.Execute then
begin
bModificarFecha.Enabled := true;
txtFichero.Text := dlAbrir.FileName;
obtenerDatosFichero;
end;
end;
procedure TformMenuPrincipal.obtenerDatosFichero;
var
CreationDate,LastModifiedDate,LastAccessedDate : TDateTime;
begin
obtenerFechaFichero (txtFichero.Text, CreationDate, fdkCreated);
obtenerFechaFichero (txtFichero.Text, LastModifiedDate, fdkLastModified);
obtenerFechaFichero (txtFichero.Text, LastAccessedDate, fdkLastAccessed);
lfCreacion.Caption := FormatDateTime('dd/mm/yyyy hh:mm:ss', CreationDate);
lfModificacion.Caption := FormatDateTime('dd/mm/yyyy hh:mm:ss', LastModifiedDate);
lfUltimoAcceso.Caption := FormatDateTime('dd/mm/yyyy hh:mm:ss', LastAccessedDate);
end;
procedure TformMenuPrincipal.bModificarFechaClick(Sender: TObject);
begin
txtFecha.Time := txtHora.Time;
case opTipoFecha.ItemIndex of
0 : cambiarFechaFichero (txtFichero.Text, txtFecha.DateTime, fdkCreated);
1 : cambiarFechaFichero (txtFichero.Text, txtFecha.DateTime, fdkLastModified);
2 : cambiarFechaFichero (txtFichero.Text, txtFecha.DateTime, fdkLastAccessed);
end;
obtenerDatosFichero;
end;
procedure TformMenuPrincipal.LWEBClick(Sender: TObject);
begin
ShellExecute(Handle, Nil, PChar('http://www.ajpdsoft.com'),
Nil, Nil, SW_SHOWNORMAL);
end;
procedure TformMenuPrincipal.FormCreate(Sender: TObject);
begin
//permitimos arrastrar y soltar
DragAcceptFiles(Handle, True);
txtFecha.DateTime := Now;
txtHora.DateTime := Now;
end;
end.
Unidad "UnidadUtilidadFechas.pas":
unit UnidadUtilidadFechas;
interface
uses Windows, SysUtils, DateUtils;
type
TFileDateKind = (fdkCreated, fdkLastModified, fdkLastAccessed);
function obtenerFechaFichero (const FileName: string;
out FileDate: TDateTime; SpecificFileDate: TFileDateKind): boolean;
function cambiarFechaFichero (const FileName: string;
FileDate: TDateTime; SpecificFileDate: TFileDateKind): boolean;
implementation
function obtenerFechaFichero (const FileName: string;
out FileDate: TDateTime; SpecificFileDate: TFileDateKind): boolean;
var
fHandle : integer;
Succeed : boolean;
FileCreationDate, FileLastModifiedDate, FileLastAccessedDate : TFileTime;
TempFileTime : TFileTime;
TempSystemTime : TSystemTime;
begin
fHandle := FileOpen(FileName, fmShareDenyNone);
FileDate := 0.0;
if fHandle < 0 then Succeed := false
else
begin
Succeed := GetFileTime(fHandle, @FileCreationDate,
@FileLastAccessedDate, @FileLastModifiedDate);
FileClose(fHandle);
if Succeed then begin
case SpecificFileDate of
fdkCreated : FileTimeToLocalFileTime(FileCreationDate, TempFileTime);
fdkLastModified : FileTimeToLocalFileTime(FileLastModifiedDate, TempFileTime);
fdkLastAccessed : FileTimeToLocalFileTime(FileLastAccessedDate, TempFileTime);
end;
if FileTimeToSystemTime(TempFileTime, TempSystemTime) then
FileDate := EncodeDateTime(TempSystemTime.wYear, TempSystemTime.wMonth,
TempSystemTime.wDay, TempSystemTime.wHour, TempSystemTime.wMinute,
TempSystemTime.wSecond, TempSystemTime.wMilliSeconds)
else Succeed := false;
end;
end;
Result := Succeed;
end;
function cambiarFechaFichero (const FileName: string; FileDate: TDateTime;
SpecificFileDate: TFileDateKind): boolean;
var
fHandle : integer;
Succeed : boolean;
TempFileTime, FinalFileTime : TFileTime;
TempSystemTime : TSystemTime;
pFileCreationDate, pFileLastModifiedDate, pFileLastAccessedDate : PFileTime;
begin
pFileCreationDate := nil;
pFileLastModifiedDate := nil;
pFileLastAccessedDate := nil;
fHandle := FileOpen(FileName, fmShareDenyWrite or fmOpenWrite);
if fHandle < 0 then Succeed := false
else
begin
DecodeDateTime(FileDate, TempSystemTime.wYear, TempSystemTime.wMonth,
TempSystemTime.wDay, TempSystemTime.wHour, TempSystemTime.wMinute,
TempSystemTime.wSecond, TempSystemTime.wMilliSeconds);
SystemTimeToFileTime(TempSystemTime, TempFileTime);
LocalFileTimeToFileTime(TempFileTime, FinalFileTime);
case SpecificFileDate of
fdkCreated : pFileCreationDate := @FinalFileTime;
fdkLastModified : pFileLastModifiedDate := @FinalFileTime;
fdkLastAccessed : pFileLastAccessedDate := @FinalFileTime;
end;
Succeed := SetFileTime(fHandle, pFileCreationDate,
pFileLastAccessedDate, pFileLastModifiedDate);
FileClose(fHandle);
end;
Result := Succeed;
end;
end.
Artículos relacionados
Créditos
Artículo realizado íntegramente por Alonsojpd miembro fundador del proyecto AjpdSoft.
Anuncios