Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

File modified date problem in makecab.exe 5.1.2600.5512

- - - - -

  • Please log in to reply
12 replies to this topic

#1
Explorer09

Explorer09

    Member

  • Member
  • PipPip
  • 182 posts
  • Joined 12-September 11
HFSLIP uses makecab.exe for making cabinets. However, I found a problem with makecab that I advice HFSLIP authors not to use it.

The problem (probably a bug) is this:
makecab will store the file creation date as the modification date of the files inside the cabinet.

People can try this:
1. Assume that you have the program to change the file date, such as NirSoft's File Date Changer.
2. Create a text file named "test.txt".
3. Use the File Date Changer to change the file created date to 1/1/2002, and the modified date 4/4/2004.
4.
makecab /d compressiontype=LZX /d compressionmemory=21 test.txt test.tx_
5. Open the cabinet with an archive viewer (such as 7-Zip), and check the modified date of test.txt.

I tested this with makecab.exe 5.1.2600.5512(WindowsXP), and the date is 1/1/2002 instead of 4/4/2004.

[Update: Only this version has this problem, other version of makecab.exe works fine.]

This problem become serious to me when I make cabinets across different folders. I often copy the files between folders and copying the files changes the file creation date of the new file. Then, makecab both files, and the two cabinets will be different even though their contents are the same file.

In contrast, cabarc.exe (another cabinet utility), did this right. In the step 4, trying this instead of makecab will give you the correct file modified date.
cabarc /m LZX:21 N test.tx_ test.txt

HFSLIP could use another version of makecab or cabarc here to eliminate the problem.

Edited by Explorer09, 18 April 2012 - 08:34 PM.



How to remove advertisement from MSFN

#2
tomasz86

tomasz86

    www.windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,520 posts
  • Joined 27-November 10
  • OS:XP Pro x86
  • Country: Country Flag
Are you 100% sure? I don't see the problem here (created by makecab.exe 5.0.2147.1):

Posted Image


I think the problem with HFSLIP and makecab/cabarc is that you can use makecab like this:
makecab text.txt
and get text.tx_ while with cabarc you need:
cabarc N text.tx_ text.txt

There's no problem when doing it for a single file but if you've got a folder of files with different extensions then it may be a little difficult.

1) With makecab.exe you can just:
FOR /F %%I IN ('DIR/B') DO MAKECAB %%I

2) For cabarc.exe maybe something like this?
SETLOCAL ENABLEDELAYEDEXPANSION
FOR /F %%I IN ('DIR/B') DO (
	IF NOT "%%~xI"=="" (
		SET EXT=%%~xI
		CABARC N %%~nI!EXT:~0,-1!_ %%I
	) ELSE (
		CABARC N %%~nI._ %%I
	)
)
The problem is that it will work only for files with 3-letter extensions. Makecab.exe is much easier to use in this way...

EDIT: Using makecab.exe is easier but cabarc.exe can do the same job too!

Edited by tomasz86, 15 April 2012 - 10:23 AM.

Posted Image
Unofficial Service Pack 5.2 for MS Windows 2000 <- use this topic if you need help with UURollup, Update Rollup 2 and other unofficial packages

#3
Explorer09

Explorer09

    Member

  • Member
  • PipPip
  • 182 posts
  • Joined 12-September 11
Okay, you convinced me to test a little further.

I downloaded another version of makecab.exe. This time it's 5.00.2134.1, and it works properly.

Now I can say it's a regression of makecab (5.1.2600.5512).

EDIT: I tested also makecab.exe version 6.1.7600.16385, which comes from Windows 7. It works properly too. Only the Windows XP version of makecab.exe has this bug.

Edited by Explorer09, 15 April 2012 - 05:47 AM.


#4
tomasz86

tomasz86

    www.windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,520 posts
  • Joined 27-November 10
  • OS:XP Pro x86
  • Country: Country Flag
So it seems that there's a bug in XP's makecab.exe... Could anyone else confirm?

I've fixed the above CABARC.exe based script so it can work for all files regardless of their extension.
Posted Image
Unofficial Service Pack 5.2 for MS Windows 2000 <- use this topic if you need help with UURollup, Update Rollup 2 and other unofficial packages

#5
Mim0

Mim0

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 768 posts
  • Joined 23-September 08

This problem become serious to me when I make cabinets across different folders. I often copy the files between folders and copying the files changes the file creation date of the new file. Then, makecab both files, and the two

That's just the way how to compare dirs. For example, I use TC for "compare by content" to be really sure if (sub)folders have the same content.

I've fixed the above CABARC.exe based script so it can work for all files regardless of their extension.

Do you have in mind to implement this to HFSLIP? If yes:
I think it should be enough to place a "correct" makecab.exe beside HFSLIP. Makecab is called often from HFSLIP so there are many places to modify.
Placing a correct makecab.exe next to HFSLIP to avoid this minor (sorry ;-P ) problem would be the better solution.

Edited by Mim0, 17 April 2012 - 05:42 AM.


#6
PROBLEMCHYLD

PROBLEMCHYLD

    The Resurrector for old Windows OS

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,528 posts
  • Joined 07-October 05
  • OS:98SE
  • Country: Country Flag

So it seems that there's a bug in XP's makecab.exe... Could anyone else confirm?

I've fixed the above CABARC.exe based script so it can work for all files regardless of their extension.

All makecab has this bug except for an older version. Heres an older version.

Believe God is the Alpha and Omega.
Believe Jesus Christ died for our sins.
Repent for your sins now or there will be
BLOOD

The Path to God


U98SESP3 03-11-2013


#7
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,540 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

It may be a bug however it is not something which I can see of any concern to HFSLIP users.

BTW, some older versions of expand cannot uncompress an LZX cabbed file so you may need to use MSZIP compression in order to remain compatible.

#8
tomasz86

tomasz86

    www.windows2000.tk

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,520 posts
  • Joined 27-November 10
  • OS:XP Pro x86
  • Country: Country Flag
@Mim0

You may want to put makecab.exe in HFTOOLS and then change all "makecab.exe" to "HFTOOLS\makecab.exe" in the script. Of course doing so will require having makecab.exe in HFTOOLS :whistle:

Or to do it simpler you can just add this line in the beginning:

IF NOT EXIST HFTOOLS\makecab.exe (SET MAKECAB=makecab) ELSE (SET MAKECAB=HFTOOLS\makecab)
and change all makecab.exe / makecab to %MAKECAB% so HFSLIP will use HFTOOLS\makecab.exe only if it exists and will use the one present in the OS if there's no makecab.exe in HFTOOLS.

Here's a cabarc.exe one-liner with LZX:21 compression to compress everything in a folder if anyone's interested:

SETLOCAL ENABLEDELAYEDEXPANSION& FOR /F %%I IN ('DIR/B') DO (IF NOT "%%~xI"=="" (SET EXT=%%~xI& CABARC -m LZX:21 N %%~nI!EXT:~0,-1!_ %%I) ELSE (CABARC -m LZX:21 N %%~nI._ %%I))

Replacing makecab.exe with cabarc.exe in HFSLIP would require some work...

Edited by tomasz86, 18 April 2012 - 12:54 AM.

Posted Image
Unofficial Service Pack 5.2 for MS Windows 2000 <- use this topic if you need help with UURollup, Update Rollup 2 and other unofficial packages

#9
Explorer09

Explorer09

    Member

  • Member
  • PipPip
  • 182 posts
  • Joined 12-September 11

All makecab has this bug except for an older version. Heres an older version.

How about using a newer version? I forgot to say that Windows 7's makecab (6.1.7600.16385) can run on Windows XP. I'm not sure about Win 2000, though.

#10
PROBLEMCHYLD

PROBLEMCHYLD

    The Resurrector for old Windows OS

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,528 posts
  • Joined 07-October 05
  • OS:98SE
  • Country: Country Flag

How about using a newer version? I forgot to say that Windows 7's makecab (6.1.7600.16385) can run on Windows XP. I'm not sure about Win 2000, though.

Good idea. I will try it over the weekend. Im sick right now trying to recover. Thanks

Believe God is the Alpha and Omega.
Believe Jesus Christ died for our sins.
Repent for your sins now or there will be
BLOOD

The Path to God


U98SESP3 03-11-2013


#11
PROBLEMCHYLD

PROBLEMCHYLD

    The Resurrector for old Windows OS

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,528 posts
  • Joined 07-October 05
  • OS:98SE
  • Country: Country Flag
MAKECAB.EXE 5.1.2600.1106 XP SP1

Doesn't have this bug either. I will add this update to Win98 SP3.
The make cab from WinXP SP3 has better compression than all the older versions of MAKECAB.EXE.
But it has the date/time stamp bug.
It also has better compression over CABARC.EXE.

Edited by PROBLEMCHYLD, 09 July 2012 - 02:14 PM.

Believe God is the Alpha and Omega.
Believe Jesus Christ died for our sins.
Repent for your sins now or there will be
BLOOD

The Path to God


U98SESP3 03-11-2013


#12
PROBLEMCHYLD

PROBLEMCHYLD

    The Resurrector for old Windows OS

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,528 posts
  • Joined 07-October 05
  • OS:98SE
  • Country: Country Flag
Is it possible to patch the MAKECAB.EXE 5.1.2600.5512 to avoid this bug? The Win XP SP3 version has better compression.

Believe God is the Alpha and Omega.
Believe Jesus Christ died for our sins.
Repent for your sins now or there will be
BLOOD

The Path to God


U98SESP3 03-11-2013


#13
tommyp

tommyp

    MSFN Addict

  • Developer
  • 1,680 posts
  • Joined 09-January 04
  • OS:none specified
  • Country: Country Flag
Nobody complained about makecab since the script was introduced in 2005. However, if the makecab.exe you have uses the same switches as the one that comes with the OS, then place it alongside the script cmd file and call it a day. I haven't tested it, and the script wasn't developed with it, so you could run into errors.
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users