MD5FileFingerprint not working?

Linux specific forum
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

MD5FileFingerprint not working?

Post by GeoTrail »

When I try to compile this code in Linux

Code: Select all

FileName$ = OpenFileRequester("Check file MD5 checksum", DefaultFile$, "ISO files (*.iso)|*.iso|All files (*.*)|*.*", 0)
If FileName$
  Result$ = MD5FileFingerprint(FileName$)

  FileSize.l = FileSize(FileName$)
  If FileSize <> -1 And FileSize <> -2 ; Check that file isn't a folder and that it exist.
    FileSize_msg.s = "Filesize: " + Str(FileSize) + " bytes."
    FileSize_msg.s + " ("
    FileSize_msg.s + Str(FileSize/1024) + " KB. "
    FileSize_msg.s + Str(FileSize/1024/1024) + " MB. "
    FileSize_msg.s + Str(FileSize/1024/1024/1024) + " GB."
    FileSize_msg.s + ")"

    MessageRequester("Result", "Filename: " + Chr(13) + Chr(10) + FileName$ + Chr(13) + Chr(10) + FileSize_msg.s + Chr(13) + Chr(10) + "MD5 checksum: " + Result$)
  EndIf
EndIf

End
I get this error message from the shell:
Gtk-CRITICAL **: file gtkfilesel.c: line 622 (gtk_file_selection_set_filename): assertion `filename != NULL' failed.
Does anyone know why this happens?
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Could you try to put something in the DefaultFile$ variable to see if it happens ? This bug doesn't seem to be related with the MD5 command:

Code: Select all

DefaultFile$ = "Test"

FileName$ = OpenFileRequester("Check file MD5 checksum", DefaultFile$, "ISO files (*.iso)|*.iso|All files (*.*)|*.*", 0)
If FileName$
  Result$ = MD5FileFingerprint(FileName$)

  FileSize.l = FileSize(FileName$)
  If FileSize <> -1 And FileSize <> -2 ; Check that file isn't a folder and that it exist.
    FileSize_msg.s = "Filesize: " + Str(FileSize) + " bytes."
    FileSize_msg.s + " ("
    FileSize_msg.s + Str(FileSize/1024) + " KB. "
    FileSize_msg.s + Str(FileSize/1024/1024) + " MB. "
    FileSize_msg.s + Str(FileSize/1024/1024/1024) + " GB."
    FileSize_msg.s + ")"

    MessageRequester("Result", "Filename: " + Chr(13) + Chr(10) + FileName$ + Chr(13) + Chr(10) + FileSize_msg.s + Chr(13) + Chr(10) + "MD5 checksum: " + Result$)
  EndIf
EndIf

End
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Hi Fred.
Sorry, I don't have Linux installed right now.

Think I was using Mandarake 10.1b when that happened.
I'll try again soon and install Mandrake again. Might be something there that did it :)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post by Henrik »

Hi
With Mandarake 9.1
I get the error if i "Cancel the requester" and have not set DefautlFile$ =""
if i on the other hand sets DefautlFile$ ="" as Fred said, it workes allso when i Cancel the filedialog.

Best regards
Henrik
Max.²
Enthusiast
Enthusiast
Posts: 175
Joined: Wed Jul 28, 2004 8:38 am

Post by Max.² »

MD5FileFingerprint definitly worked for me on Linux; what I had troubles with was the return value of the Directory functions when the file was only mounted read-only.
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Thank for testing, I will fix the OpenFileRequester() command.
Post Reply