March 04, 2021, 10:38:47 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
File Utilities
»
[bmx] File attributes by JoshK [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bmx] File attributes by JoshK [ 1+ years ago ] (Read 1348 times)
BlitzBot
Jr. Member
Posts: 1
[bmx] File attributes by JoshK [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:42 AM »
Title :
File attributes
Author :
JoshK
Posted :
1+ years ago
Description :
Note that you must call ShowFile() before a hidden file can be read with ReadFile().
Code :
Code: BlitzMax
SuperStrict
Import
pub.win32
Private
Const
FILE_ATTRIBUTE_HIDDEN:
Int
=$2
Extern
"win32"
Function
SetFileAttributesA
(
lpFileName$z,dwFileAttributes:
Int
)
Function
GetFileAttributesA:
Int
(
lpFileName$z
)
EndExtern
Public
Function
HideFile
(
path:
String
)
Local
attrib:
Int
attrib=GetFileAttributesA
(
path
)
If
Not
(
FILE_ATTRIBUTE_HIDDEN & attrib
)
SetFileAttributesA
(
path,attrib|FILE_ATTRIBUTE_HIDDEN
)
EndIf
EndFunction
Function
ShowFile
(
path:
String
)
Local
attrib:
Int
attrib=GetFileAttributesA
(
path
)
If
(
FILE_ATTRIBUTE_HIDDEN & attrib
)
SetFileAttributesA
(
path,attrib~FILE_ATTRIBUTE_HIDDEN
)
EndIf
EndFunction
Function
FileHidden:
Int
(
path:
String
)
Local
attrib:
Int
attrib=GetFileAttributesA
(
path
)
If
(
FILE_ATTRIBUTE_HIDDEN & attrib
)
Return
True
EndIf
EndFunction
Comments :
none...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
File Utilities
»
[bmx] File attributes by JoshK [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal