Hello everybody.
I had noticed a possible bug regarding SetFolder( str ) command.
I'm trying to make a program that read the content of specific folders on Windows.
So I called SetFolder( str ) command to set the 'read' folder to a specific path.
However, when I called GetReadPath() to check the new read path, it still didn't show the intended new path.
Instead, it shows the defaut read path which is inside the project folder.
I tried to remedy this by calling the SetRawWritePath ().
It does set the 'write' folder to the intended path, but unfortunately AppGameKit did not read the content of a 'write' folder.
So I still unable to read the content of a folder I want no matter what command I used.
Is this a bug? Or SetFolder( str ) was not intended to be able to read folders outside of the project folder?
I'm 100% sure the code is not the cause of this weird behaviour.
I thought the limitation of read and write only applied for mobile?
It would be great if SetFolder( str ) can really set its path freely, like SetRawWritePath ().
Here's the code, just in case.
`##############################################################################################################################################################################################
Function DefineSearchVar()
`global baseDir$ = "D:"
`baseDir$ = "D:\Gamecube roms"
`SetFolder("C:/Users/Asus/Desktop/Misc")
SetRawWritePath("C:\Users\Asus\Desktop\Neon")
SetFolder("C:\Users\Asus\Desktop\Neon")
`baseDir$ = GetFolder()
`prevDir$ = GetFolder()
Global baseDir$
baseDir$ = GetWritePath()
GLOBAL prevDir$
prevDir$ = GetWritePath()
global lastObj = 499
global endObj = 500
global leftclicked = 0
global firstfile = 0
global filesearch = 0
global fileLevel = 0
global currentfile$
global currentFileType = 0
`global prevDir$ = baseDir$
global prevDirArray = 1
global tempPrevDir$
`global baseDir$ = baseDir$
global boxsize# as float
global fileSize as integer
global allowMakeBox = 0
global cityMade = 0
global lastArray = 0
global boxmade = 0
global fileMade = 0
global fileNotMade = 0
global fileNotExplored = 0
global FolderSizeCalculated = 0
global folderSize as integer `temporary variable to store folder size/height
`global NPCcontrol : ` 0 = auto , 1 = manual
global dim FileName$[2000000,3] as string
FileName$[1,1] = "filename" `file name
FileName$[1,2] = "fileDir" `the directory that this file is in
FileName$[1,3] = baseDir$ `the directory that the parent folder of this file is in
global dim FileNum[2000000,8] as integer
FileNum[1,1] = 0 `objNum `number of object representing this file
FileNum[1,2] = fileLevel
FileNum[1,3] = fileSize
FileNum[1,4] = boxmade `boxmade = 1 if box reperesenting this file was made
FileNum[1,5] = 0 `indexed
FileNum[1,6] = 0 `explored
FileNum[1,7] = 0 `fileType
FileNum[1,8] = 0 `PrevFolderArrayNumber
ENDFUNCTION
`##############################################################################################################################################################################################
`##############################################################################################################################################################################################
`##############################################################################################################################################################################################
`##############################################################################################################################################################################################
Function SearchDriveInitialize()
`perform checklist for files `Check files current directory
itemCount = GetFileCOunt() + GetFolderCount()
`============================================================================================================
`Register FILES info in base directory
If GetFileCOunt() > 0
FOR t = (1) to GetFileCOunt()
`Register first file info
If (t = 1)
`GetFirstFile()
currentfile$ = GetFirstFile()
currentpath$ = Getfolder()
iFileID = OpenToRead(currentfile$)
`pathExist = path exist(baseDir$+"/"+currentfile$)
fileSize = GetFileSize(iFileID)
`Register this file info in array
lastobj = lastobj + 1
FileNum[lastobj,1] = lastobj
FileNum[lastobj,2] = fileLevel
If fileSize < 0
fileSize = 2147483647 + (fileSize + 2147483648)
ELSE
fileSize = filesize
ENDIF
FileNum[lastobj,3] = fileSize `file size(currentfile$)
`FileNum[lastobj,4] = lastobj `prev directory array address
FileNum[lastobj,5] = 1 `mark this file as indexed
FileNum[lastobj,6] = 1 `mark this file as explored
FileNum[lastobj,7] = currentFileType
FileName$[lastobj,1] = currentfile$
FileName$[lastobj,2] = currentpath$
FileName$[lastobj,3] = prevDir$
SetTextString(lastobj, FileName$[lastobj,1])
SetTextVisible( lastobj, 1 )
CLoseFile(iFileID)
If GetFileCOunt() > 1
currentfile$ = GetNextFile()
endif
Endif `If (t = 1)
`====================================================================================================================
`Register next files info
If (t > 1)
`currentfile$ = GetNextFile()
iFileID = OpenToRead(currentfile$)
`pathExist = path exist(baseDir$+"/"+currentfile$)
fileSize = GetFileSize(iFileID)
`currentpath$ = baseDir$
`pathExist = path exist(baseDir$+"/"+currentfile$)
`currentFileType = get file type()
`Register next file in array
lastobj = lastobj + 1
FileNum[lastobj,1] = lastobj
FileNum[lastobj,2] = fileLevel
If fileSize < 0
fileSize = 2147483647 + (fileSize + 2147483648)
ELSE
fileSize = filesize
ENDIF
FileNum[lastobj,3] = fileSize `file size(currentfile$)
`FileNum[lastobj,4] = lastobj `prev directory array address
FileNum[lastobj,5] = 1 `mark this file as indexed
FileNum[lastobj,6] = 1 `mark this file as explored
FileNum[lastobj,7] = currentFileType
FileName$[lastobj,1] = currentfile$
FileName$[lastobj,2] = currentpath$
FileName$[lastobj,3] = prevDir$
SetTextString(lastobj, FileName$[lastobj,1])
SetTextVisible( lastobj, 1 )
CLoseFile(iFileID)
If t < GetFileCOunt()
currentfile$ = GetNextFile()
Endif
Endif `If (t > 1)
NEXT t `FOR t = (1) to (checklist quantity() )
ENDIF `If getfileCount() > 0)
`empty checklist
`Set dir baseDir$
`Perform checklist for files
lastArray = lastObj
fileNotMade = lastObj
fileSearch = 1
allowMakeBox = 1
FolderSizeCalculated = 1
ENDFUNCTION
`##############################################################################################################################################################################################
`##############################################################################################################################################################################################
`##############################################################################################################################################################################################
`##############################################################################################################################################################################################