|
@@ -195,9 +195,9 @@ returns: 0 if file at @path doesn't exist, FILETYPE_FILE (1) if the file is a pl
|
|
End Rem
|
|
End Rem
|
|
Function FileType( path$ )
|
|
Function FileType( path$ )
|
|
FixPath path
|
|
FixPath path
|
|
- Local mode,size,mtime,ctime
|
|
|
|
- If stat_( path,mode,size,mtime,ctime ) Return 0
|
|
|
|
- Select mode & S_IFMT_
|
|
|
|
|
|
+ Local Mode,size,mtime,ctime
|
|
|
|
+ If stat_( path,Mode,size,mtime,ctime ) Return 0
|
|
|
|
+ Select Mode & S_IFMT_
|
|
Case S_IFREG_ Return FILETYPE_FILE
|
|
Case S_IFREG_ Return FILETYPE_FILE
|
|
Case S_IFDIR_ Return FILETYPE_DIR
|
|
Case S_IFDIR_ Return FILETYPE_DIR
|
|
End Select
|
|
End Select
|
|
@@ -210,8 +210,8 @@ returns: The time the file at @path was last modified
|
|
End Rem
|
|
End Rem
|
|
Function FileTime( path$ )
|
|
Function FileTime( path$ )
|
|
FixPath path
|
|
FixPath path
|
|
- Local mode,size,mtime,ctime
|
|
|
|
- If stat_( path,mode,size,mtime,ctime ) Return 0
|
|
|
|
|
|
+ Local Mode,size,mtime,ctime
|
|
|
|
+ If stat_( path,Mode,size,mtime,ctime ) Return 0
|
|
Return mtime
|
|
Return mtime
|
|
End Function
|
|
End Function
|
|
|
|
|
|
@@ -221,8 +221,8 @@ returns: Size, in bytes, of the file at @path, or -1 if the file does not exist
|
|
end rem
|
|
end rem
|
|
Function FileSize( path$ )
|
|
Function FileSize( path$ )
|
|
FixPath path
|
|
FixPath path
|
|
- Local mode,size,mtime,ctime
|
|
|
|
- If stat_( path,mode,size,mtime,ctime ) Return -1
|
|
|
|
|
|
+ Local Mode,size,mtime,ctime
|
|
|
|
+ If stat_( path,Mode,size,mtime,ctime ) Return -1
|
|
Return size
|
|
Return size
|
|
End Function
|
|
End Function
|
|
|
|
|
|
@@ -232,17 +232,17 @@ returns: file mode flags
|
|
end rem
|
|
end rem
|
|
Function FileMode( path$ )
|
|
Function FileMode( path$ )
|
|
FixPath path
|
|
FixPath path
|
|
- Local mode,size,mtime,ctime
|
|
|
|
- If stat_( path,mode,size,mtime,ctime ) Return -1
|
|
|
|
- Return mode & 511
|
|
|
|
|
|
+ Local Mode,size,mtime,ctime
|
|
|
|
+ If stat_( path,Mode,size,mtime,ctime ) Return -1
|
|
|
|
+ Return Mode & 511
|
|
End Function
|
|
End Function
|
|
|
|
|
|
Rem
|
|
Rem
|
|
bbdoc: Set file mode
|
|
bbdoc: Set file mode
|
|
end rem
|
|
end rem
|
|
-Function SetFileMode( path$,mode )
|
|
|
|
|
|
+Function SetFileMode( path$,Mode )
|
|
FixPath path
|
|
FixPath path
|
|
- chmod_ path,mode
|
|
|
|
|
|
+ chmod_ path,Mode
|
|
End Function
|
|
End Function
|
|
|
|
|
|
Rem
|
|
Rem
|
|
@@ -252,7 +252,7 @@ End Rem
|
|
Function CreateFile( path$ )
|
|
Function CreateFile( path$ )
|
|
FixPath path
|
|
FixPath path
|
|
remove_ path
|
|
remove_ path
|
|
- Local t=fopen_( path,"wb" )
|
|
|
|
|
|
+ Local t:Byte Ptr=fopen_( path,"wb" )
|
|
If t fclose_ t
|
|
If t fclose_ t
|
|
If FileType( path )=FILETYPE_FILE Return True
|
|
If FileType( path )=FILETYPE_FILE Return True
|
|
End Function
|
|
End Function
|
|
@@ -367,7 +367,7 @@ End Rem
|
|
Function DeleteDir( path$,recurse=False )
|
|
Function DeleteDir( path$,recurse=False )
|
|
FixPath path,True
|
|
FixPath path,True
|
|
If recurse
|
|
If recurse
|
|
- Local dir=ReadDir( path )
|
|
|
|
|
|
+ Local dir:Byte Ptr=ReadDir( path )
|
|
If Not dir Return
|
|
If Not dir Return
|
|
Repeat
|
|
Repeat
|
|
Local t$=NextFile( dir )
|
|
Local t$=NextFile( dir )
|
|
@@ -407,14 +407,14 @@ Rem
|
|
bbdoc: Return next file in a directory
|
|
bbdoc: Return next file in a directory
|
|
returns: File name of next file in directory opened using #ReadDir, or an empty string if there are no more files to read.
|
|
returns: File name of next file in directory opened using #ReadDir, or an empty string if there are no more files to read.
|
|
End Rem
|
|
End Rem
|
|
-Function NextFile$( dir )
|
|
|
|
|
|
+Function NextFile$( dir:Byte Ptr )
|
|
Return readdir_( dir )
|
|
Return readdir_( dir )
|
|
End Function
|
|
End Function
|
|
|
|
|
|
Rem
|
|
Rem
|
|
bbdoc: Close a directory
|
|
bbdoc: Close a directory
|
|
End Rem
|
|
End Rem
|
|
-Function CloseDir( dir )
|
|
|
|
|
|
+Function CloseDir( dir:Byte Ptr )
|
|
closedir_ dir
|
|
closedir_ dir
|
|
End Function
|
|
End Function
|
|
|
|
|
|
@@ -426,7 +426,7 @@ about: The @skip_dots parameter, if true, removes the '.' (current) and '..'
|
|
end rem
|
|
end rem
|
|
Function LoadDir$[]( dir$,skip_dots=True )
|
|
Function LoadDir$[]( dir$,skip_dots=True )
|
|
FixPath dir,True
|
|
FixPath dir,True
|
|
- Local d=ReadDir( dir )
|
|
|
|
|
|
+ Local d:Byte Ptr=ReadDir( dir )
|
|
If Not d Return
|
|
If Not d Return
|
|
Local i$[100],n
|
|
Local i$[100],n
|
|
Repeat
|
|
Repeat
|