Skip to content

Relative file paths behave inconsistently in FULLPATH() and FCREATE() #19

Open

Description

@geosyscr-oss

Description

Relative file paths appear to be handled inconsistently by the FoxDev Studio Runtime.

The current directory can be obtained correctly with:

? FULLPATH("")

which returns:

C:\FOXDEVPRUEBAS\REVISARCOMPROBANTES

The file PRUEBA.TXT exists in that directory, and:

? FILE("prueba.txt")

correctly returns:

.T.

However, using the same relative filename with FULLPATH() causes an error:

? FULLPATH("PRUEBA.TXT")

Result:

Error invoking remote method 'files:lowlevel':
Error: Access denied: PRUEBA.TXT

Similarly:

lnArchivo = FCREATE("PRUEBA.TXT")

produces:

Error invoking remote method 'files:lowlevel':
Error: Access denied: PRUEBA.TXT

Using the absolute path works correctly:

lnArchivo = FCREATE("C:\FoxDevPruebas\RevisarComprobantes\PRUEBA.TXT")

Another workaround that works is constructing the absolute path manually:

lcArchivo = FULLPATH("") + "\PRUEBA.TXT"
lnArchivo = FCREATE(lcArchivo)
Expected behavior

In Visual FoxPro, relative filenames are resolved against the current working directory. Since FILE("prueba.txt") already resolves the relative path correctly in FoxDev, I would expect FULLPATH("prueba.txt") and FCREATE("prueba.txt") to behave consistently as well.

Additional observation

CURDIR() does not return the current directory in the Command Window, while:

? FULLPATH("")

does return it correctly.

This was tested with:

FoxDev Studio Runtime 0.1.0

The issue appears to affect the handling of relative paths specifically; absolute paths work correctly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions