SRL Archive - Delphi/FPC Help and Tutorials

Faster DeleteFile();...


Jason2gs

2007-08-17 02:24:23

My sister was asking me if I felt LimeWire was safe, I told her that if she had decent antivirus, half a brain in her head, and she stuck to mp3s, she's be fine. She asked my dad and mentioned that "Michael has LimeWire on his laptop and he hasn't any problems with it". Well, he called me out there and asked me about it. I said basically the same thing I told my sister. He said he would trust me and went ahead and let my sister use LimeWire.

That was last night, and almost every time I look over when she's on the computer since, she has LimeWire up and she's downloading something.

I tell her that if she goes and screws something up, it's me who's gonna get the heat. (My dad trusted me when I said it was safe. What's he gonna think of my judgment if LimeWire messes something up?)

I don't know if she was joking or not, but she got short with me and said that it was my own dumb fault for saying it was safe. Then I asked her again later on to please be careful with it, and she said something about how I don't need to keep repeating it…

So, as a precaution for if things get out of hand, I'm working on Nolwfy. No LimeWire for you :)

Just an application that sits behind the scenes and deletes LimeWire/LimeWire's Installer/Any LimeWire program files.

It's coming along alright, but the DeleteFile function in Delphi, is a bit slow, and I'm not sure if checking for the existence of the file in the first place would speed things up or not.

One last thing: There isn't a Delphi component made specifically for dealing with files, is there?

Thank you for your time!

-Mike

Bourdou!

2007-08-17 03:38:49

Stinks if she screws up her computer before your done…

Miitchyy

2007-08-17 07:40:05

If your going to completely shut off limewire why not just make something that ends the process?

Jason2gs

2007-08-17 10:22:21

From: Bourdou
Stinks if she screws up her computer before your done…


My laptop. Her desktop.

From: Kevin Wolf
If your going to completely shut off limewire why not just make something that ends the process?


Ooh, I didn't think of that :)

Edit: Ooh… How do I grab the Process ID?

Edit2: Never mind. Found some code :)

Harry

2007-08-17 10:50:27

[offtopic] You can get viruses from mpg's right? [/offtopic]

Jason2gs

2007-08-17 11:10:43

Mpgs as in.. Mp3s? (MPEG Layer-3)

http://radio.javaranch.com/frank/2005/01/01/1104606950000.html

Smartzkid

2007-08-17 11:45:28

I think mpg's are safe…
wmv's (alnong with asx and wma) are not.

Jason, you might try going straight to the API to delete the files.
(In SCAR: function DeleteFile(thefile: string):LongInt; external 'DeleteFileA@kernel32.dll stdcall'; )

Jason2gs

2007-08-17 12:17:32

Hmm.. I might just do that. API Calls are supposed to be faster?

Edit: I may still go with deleting the file, but Wolf's idea of terminating the process works GREAT! :)

Spky

2007-08-17 12:42:53

Delphi's DeleteFile calls from WinApi anyway.

Jason2gs

2007-08-17 13:04:12

O rly? (Sorry. Just came from the Orly Owl thread :rolleyes:)

So there's no faster DeleteFile than the one already in Delphi? That still leaves the question: Does checking for the existence of a file save time?

Harry

2007-08-17 14:32:07

Requested to be removed by Jason2gs.

Markus

2007-08-17 16:55:09

Telnet to your router and block all outgoing connections on the ports limewire uses from the ip of the desktop.

Bobarkinator

2007-08-17 22:05:33

Make your own :rolleyes: