[Implemented] Better File Lib

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

[Implemented] Better File Lib

Post by Dummy »

1. I miss the missing share_read flag in ALL PB's Filecommands! If I wanna write a log file I can't open it with notepad until the Program closes the file!

For the ReadFile() command maybe an optional flag?

ReadFile(#File, FileName$[, flags])

Possible values for flags:
#PB_FILE_NO_SHARE_READ
#PB_FILE_SHARE_WRITE

2. Better CreateDirectory():
The code

Code: Select all

CreateDirectory("C:\test1\test")
doesn't work, if "C:\test1" doesn't exist!

Please make it work!

I know there are lots of codes availble, but none of those is ASM/WinAPI optimized!

3. Please add ASM optimized
-CheckWildcardString(WildCards$, String$)
-CheckWildcardArray()
-CheckWildcardList()

I know for CheckWildcardString(WildCards$, String$) there are lots of codes availble, but none of those is ASM optimized!

If these changes are also possible for Linux, please add them to it, too!
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: [Windows]Better File Lib

Post by PB »

> CreateDirectory("C:\test1\test")
> doesn't work, if "C:\test1" doesn't exist!

That's normal. The Windows API command (CreateDirectory) also fails if you
do it like that. You need to use the MakeSureDirectoryPathExists API instead.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Post by flaith »

Hi,

why under dos cmd : "md c:\test1\test" work ?
“Fear is a reaction. Courage is a decision.” - WC
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> why under dos cmd : "md c:\test1\test" work ?

Different command and different Operating System.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Gansta93
Enthusiast
Enthusiast
Posts: 238
Joined: Wed Oct 20, 2004 7:16 pm
Location: The Village
Contact:

Post by Gansta93 »

Hi,

I think a flag for OpenFile() to place the read/write pointer at the end of the file would be good.
Be seeing you! :-)

Gansta93
If you speak french, you can visite Le Monde de Gansta93 (Gansta93's World)
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Re: [Windows]Better File Lib

Post by Dummy »

PB wrote:You need to use the MakeSureDirectoryPathExists API instead.
Is it accessable through PureBasic?

Is the same Command(with same Parameters) avaible in Linux/comming Mac

> No -> no Crossplatform compatibility! :evil:

Hey Fred!

Will you add these features to PB till next Update?
Post Reply