Remove the extension part of a file.

Share your advanced PureBasic knowledge/code with the community.
User avatar
Demivec
Addict
Addict
Posts: 4270
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Remove the extension part of a file.

Post by Demivec »

Since quotes are in fashion, here's another:

“The fundamental law of computer science: As machines become more powerful, the efficiency of algorithms grows more important, not less.” — Nick Trefethen
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Re: Remove the extension part of a file.

Post by Kale »

luis wrote:The phrase you just quoted is inside the link I posted BTW, and it's cited trying to understand its meaning, instead of using it as a shield for your own shortcomings.
It's meaning is clear, stop wasting your time on trivial ****! :wink:
--Kale

Image
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Re: Remove the extension part of a file.

Post by Hroudtwolf »

@Kale
Facts do not cease to exist because they are ignored.
Aldous Huxley
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Re: Remove the extension part of a file.

Post by Kale »

Hroudtwolf wrote:@Kale
Facts do not cease to exist because they are ignored.
Aldous Huxley
:?:
--Kale

Image
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: Remove the extension part of a file.

Post by Rook Zimbabwe »

Facts do not cease to exist because they are ignored.
Tell that to a politician or fanatic! :wink:

I have used them all and all work well... As a test I deleted ALL extensions from a 5mb test drive (laptop HDD) and then deleted everything listed... adds a layer of security to a delete!

NEXT UP: reading each file 1 byte at a time and writing a random 1 or 0 THEN deleting it!
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Remove the extension part of a file.

Post by WilliamL »

So let me get this straight.

If you create the RegualrExpression then you should 'FreeRegularExpression' before you create it again but if you recreate it with the same constant then it is ok since pb just frees it for you. I suppose if you created the RegularExpression using #PB_Any then you would have a memory leak!

I'm guessing this applies to images created in procedures also. I've been a little lax in that regard.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
Post Reply