Jump to content

Truncate a file: Difference between revisions

m
{{header|ZX Spectrum Basic}}
m ({{omit from|ZX Spectrum Basic}})
m ({{header|ZX Spectrum Basic}})
Line 162:
<lang bash># Truncate a file named "myfile" to 1440 kilobytes.
truncate -s 1440k myfile</lang>
 
=={{omit fromheader|ZX Spectrum Basic}}==
 
We can truncate files that were saved as binary:
 
<lang zxbasic>10 CLEAR 29999
20 PRINT "Start tape to load file to truncate."
30 INPUT "Which file do you want to truncate?";f$
40 LOAD f$ CODE 30000
50 "Input how many bytes do you want to keep?";n
60 PRINT "Please insert a blank tape for new file."
70 SAVE f$ CODE 30000,n
80 STOP</lang>
 
{{omit from|GUISS}}
{{omit from|ZX Spectrum Basic}}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.