February 25, 2021, 02:34:01 AM
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
»
[bb] osx file attributes by Dabhand [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] osx file attributes by Dabhand [ 1+ years ago ] (Read 569 times)
BlitzBot
Jr. Member
Posts: 1
[bb] osx file attributes by Dabhand [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:42 AM »
Title :
osx file attributes
Author :
Dabhand
Posted :
1+ years ago
Description :
Find various file attributes on osx:-
- Last accessed: Use ctime(&fst.st_atime)
- Last modified: Use ctime(&fst.st_mtime)
- Last changed: Use ctime(&fst.st_ctime)
C++ code in the example returns 'Last accessed' information.
Sorry, this is for Blitzmax... I buggered the language tagging up! Sorwy
Code :
Code: BlitzBasic
//findmeta.m
#include <sys/stat.h>
char * FindMeta
(
char *filepath
)
{
struct stat fst
;
bzero
(
&fst,sizeof
(
fst
)
)
;
if
(
stat
(
filepath,&fst
)
!=
0
)
{
return
(
""
)
;}
return
(
ctime
(
&fst.st_atime
)
)
;
}
'Blitzmax example
Import
"findMeta.m"
Extern
"C"
Function
FindMeta$z
(
filepath:Byte Ptr
)
End
Extern
Print
FindMeta
(
CurrentDir
$
(
)
+
"/test.app"
)
Comments :
none...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
File Utilities
»
[bb] osx file attributes by Dabhand [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal