FileSize Function And Extended Paths

Just starting out? Need help? Post your questions and find answers here.
rmgregory243
New User
New User
Posts: 4
Joined: Tue Jul 19, 2022 10:11 am

FileSize Function And Extended Paths

Post by rmgregory243 »

In PureBasic 6.10 LTS beta 9 (Windows - x64), the FileSize function returns incorrect results when given a valid filename beginning with "\\?\".
User avatar
jacdelad
Addict
Addict
Posts: 2029
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: FileSize Function And Extended Paths

Post by jacdelad »

? is not a valid character for filenames.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
STARGÅTE
Addict
Addict
Posts: 2259
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: FileSize Function And Extended Paths

Post by STARGÅTE »

jacdelad wrote: Sat Mar 30, 2024 9:31 am ? is not a valid character for filenames.
Extended-length path notation \\?\

@rmgregory243: I think it is not supported by the Pure Basic function.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
jacdelad
Addict
Addict
Posts: 2029
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: FileSize Function And Extended Paths

Post by jacdelad »

Oh sorry, didn't know that. That's totally new for me.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
breeze4me
Enthusiast
Enthusiast
Posts: 633
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: FileSize Function And Extended Paths

Post by breeze4me »

I tested it with a few files and it seems to work fine for local disk files.
Note that the return value is a quad type.
Tested with 6.10 LTS x64/x86.

Code: Select all

sz.q = FileSize("\\?\Z:\test.txt")
Quin
Addict
Addict
Posts: 1135
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: FileSize Function And Extended Paths

Post by Quin »

Same results as Breeze4Me. I tried \\?\c:\test.txt, \\?\c:\games\test.txt, and \\?\c:\games, all seemingly worked as expected.
Fred
Administrator
Administrator
Posts: 18345
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: FileSize Function And Extended Paths

Post by Fred »

Works here as well, do you have any more information ?
Post Reply