Autor Beitrag
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Fr 30.07.04 12:53 
Hallo

wie kann ich mit Delhpi eine Datei kopieren, die von einem anderen Programm genutz wird?

thÄnxXfcg


Moderiert von user profile iconPeter Lustig: Topic aus CLX / Delphi Language (Object-Pascal) verschoben am Fri 30.07.2004 um 14:12

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Fr 30.07.04 12:59 
Moin!

So lange das andere Programm beim öffnen keine Sharing Werte gesetzt hat die das Lesen verhindern, dann kannst du es mit einem TFileStream zum lesen öffnen und die Sharing Attribute so setzen, das du keinen behinderst. Damit solltest du die Dateien einfach kopieren können.

Eine andere Möglichkeit wäre es die ShellAPI zu verwenden. Zu beiden Problemen gibt es hier schon Lösungen, also einfach mal suchen...

MfG
Muetze1
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 31.07.04 00:06 
Wenn die Datei noch nicht mal Lese-Zugriff erlaubt, gibt es immernoch ein Hintertürchen: Direkter Dateisystem-Zugriff. (BTW: Viel Spaß beim Implementieren.) Wobei es da sicherlich manchmal einfacher ist, das andere Programm einfach zu killen ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.