Shop OBEX P1 Docs P2 Docs Learn Events
Something is wrong with curdir$() — Parallax Forums

Something is wrong with curdir$()

pik33pik33 Posts: 2,366
edited 2022-02-10 10:57 in BASIC (for Propeller)
#include "dir.bi"
const module$="aurora.mod"
mount "/sd", _vfs_open_sdcard()
chdir "/sd/mod"
open "/sd/mod/"+module$ for input as #4
print geterr()
close #4

The result: 0, as expected, the file exists on the card

#include "dir.bi"
const module$="aurora.mod"
mount "/sd", _vfs_open_sdcard()
chdir "/sd/mod"
print curdir$()
open "/sd/mod/"+module$ for input as #4
print geterr()
close #4

The result:
/sd/mod
16

#include "dir.bi"
const module$="aurora.mod"
mount "/sd", _vfs_open_sdcard()
chdir "/sd/mod"
var j=0: if j=1 then print cd$()
open "/sd/mod/"+module$ for input as #4
print geterr()
close #4

function cd$() as string
return curdir$()
end function

The result is now also 16 although curdir$ is not even called. It is sufficient to have it compiled and opening the file gives error #16 and the file is not opened at all.

Sign In or Register to comment.