Datei schliessen

  • Hallo,
    ich hätte da noch einmal einefrage, und zwar warum kann mein Datei $as_temp nicht umbenannt werden??
    Wenn ich es nämmlich versuche dann kommt die von mir eingebaute Fehlermeldung und die Datei ist auch nicht umbennant.

    Hat vll jemand eine Idee?

    [autoit]

    $as_artikel = ("artikel.php") ; Der Dateiname der artikel-Datei
    $as_temp = ("temp.php") ; Der Dateiname der temp-Datei

    [/autoit][autoit]

    Func upload() ;LÖSCHEN EINER VORHANDENDEN DATEI
    FileDelete ( $as_artikel )

    [/autoit][autoit][/autoit][autoit]

    ;SCHREIBEN DER NEUEN DATEI
    FileCopy ( "dummy_wichtig_nicht_loeschen.txt", $as_temp, 1)
    FileOpen ( $as_temp, 1 )
    FileWriteLine ( $as_temp, "
    " & @CRLF)
    FileWriteLine ( $as_temp, "" & GUICtrlRead($Input1) & "
    " & @CRLF)
    FileWriteLine ( $as_temp, "Gepostet am " & GUICtrlRead($Input3) & " von " & GUICtrlRead($Input2) & "
    " & @CRLF)
    FileWriteLine ( $as_temp, "
    " & @CRLF)
    FileWriteLine ( $as_temp, "" & GUICtrlRead($Edit1) & "
    " & @CRLF)
    FileWriteLine ( $as_temp, "" & @CRLF & "")
    FileClose ( $as_temp )

    [/autoit][autoit][/autoit][autoit]

    ;DOWNLOAD DER DATEN

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    ;VERARBEITUNG DER DATEIEN
    $temp = FileOpen ( $as_temp, 1 )
    $read = FileRead ($as_artikel , 90000000 )
    FileWrite($temp, $read)
    FileClose ( $as_temp )
    FileDelete ( $as_artikel )
    MsgBox(0, $as_titel & " " & $as_version, "DATEI WURDE BEARBEITET")

    [/autoit][autoit][/autoit][autoit]

    ;UPLOAD DER DATEN
    GUICtrlSetData ( $Input1, "" )
    GUICtrlSetData ( $Input2, "" )
    GUICtrlSetData ( $Input3, "" )
    GUICtrlSetData ( $Edit1, "" )
    FileClose ( $as_artikel )
    FileClose ( $as_temp )
    $temp2 = FileMove ($as_temp, $as_artikel)
    If $temp2 = 0 Then MsgBox (16, $as_titel & " " & $as_version, "Die Datei " & $as_temp & " konnte nicht umbennant werden")
    EndFunc

    [/autoit]

    Einmal editiert, zuletzt von Implant (31. Juli 2009 um 22:53)

  • Auch wenn ich es so mache, also Kopieren und dann löschen geht es nicht, aber warum nur??

    [autoit]

    FileCopy ( $as_temp, $as_artikel, 1)
    $temp2 = FileDelete ( $as_temp )
    If $temp2 = 0 Then MsgBox (16, $as_titel & " " & $as_version, "Die Datei " & $as_temp & " konnte nicht gelöscht werden")

    [/autoit]