Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Truncate-a-file/PureBasic/truncate-a-file.basic
Normal file
13
Task/Truncate-a-file/PureBasic/truncate-a-file.basic
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Procedure SetFileSize(File$, length.q)
|
||||
Protected fh, pos, i
|
||||
If FileSize(File$) < length
|
||||
Debug "File to small, is a directory or does not exist."
|
||||
ProcedureReturn #False
|
||||
Else
|
||||
fh = OpenFile(#PB_Any, File$)
|
||||
FileSeek(fh, length)
|
||||
TruncateFile(fh)
|
||||
CloseFile(fh)
|
||||
EndIf
|
||||
ProcedureReturn #True
|
||||
EndProcedure
|
||||
Loading…
Add table
Add a link
Reference in a new issue