change Folder Date / Time, how ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

change Folder Date / Time, how ?

Post by AUGE_OHR »

hi,

i want to change Date / Time of Folder and found

Code: Select all

   hb_FSetDateTime( cFileName, dDate, cTime )
but it sees only work on File not Folder :o
how to set Date / Time on Folder under harbour :idea:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: change Folder Date / Time, how ?

Post by AUGE_OHR »

hi,

found out that i need FILE_FLAG_BACKUP_SEMANTICS for CreateFileW (Unicode) when it is a Directory instead of File
https://docs.microsoft.com/en-us/window ... reatefilea
You must set this flag to obtain a handle to a directory.
A directory handle can be passed to some functions instead of a file handle.
For more information, see the Remarks section.
will make a Sample

---

i do record TV to *.MPG and transfer them via USB-Stick
when copy Files to NAS it does create Folder with Date / Time when Folder was create ...

i can "touch" Files, which was create, with "old" Date/Time but not Folder with harbour
i want to "set" Date/Time of Folder to same Date/Time when Files was create
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: change Folder Date / Time, how ?

Post by AUGE_OHR »

hi,

TouchDir.EXE
TOUCHDIR.ZIP
(4.35 KiB) Downloaded 120 times
i do record *.MPG from TV , in seperate Folder, and do transfer via USB-Stick to NAS
when copy a Folder from USB-Stick to NAS it will create Folder with actual Date / Time

TouchDir.EXE will look for "latest" File in Sub-Diretory and "Set" Date / Time to "this"
it will NOT touch your Files, only Folder Date / Time

! Note : Source Code use "W" API Function so use UNICODE LIB
have fun
Jimmy
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: change Folder Date / Time, how ?

Post by franco »

Nice work Jimmy
All The Best,
Franco
Canada
Post Reply