Just wanted to confirm for Deletefile(Filename$) that filename$ must be the full path name and not just the file name obtained from Nextdirectoryentry().
I am going thruough a directory and deleting files based on time of day they were created by a trail cam.
Delete files
Re: Delete files
Nope, DeleteFile() supports both absolute and relative paths. Just tested by creating a file called test.txt, and running:
From within the same directory, and it worked.
Code: Select all
DeleteFile("test.txt")
Re: Delete files
Relative paths and lone file names without a path are resolved based on the current directory.. Use the functions GetCurrentDirectory() and SetCurrentDirectory() to verify and/or set the current directory.
If you use full paths for all of your program's other file operations or the other operations are not taking place concurrently you can set the current directory to the where the deletions are taking place and this will allow you to only need the filename for the DeleteFile() function.
If you use full paths for all of your program's other file operations or the other operations are not taking place concurrently you can set the current directory to the where the deletions are taking place and this will allow you to only need the filename for the DeleteFile() function.