android
  #21  
Old 08-23-2011, 04:11 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

No, I see the directory IS created in the right place. The issue might lie in me using the already there file operations with just a change in file-path, I'm probably messing something up there and I've stared myself blind at the code, I think I'll find it much easier after sleeping on it.

The only thing I added was:
lfs.mkdir("Backup");
Since i'm already working within the correct root folder it is created where I want it.
As I said, the problem is probably in my strings holding the paths for other parts of the code, probably mixed them up somewhere. I'll fix it tomorrow. Bye for now.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

Advertisement [Remove Advertisement]

  #22  
Old 08-23-2011, 04:46 PM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

i have changed source code to better suit mine needs to:
Quote:
local Backup = '..\\' .. Apeopex.UserButtons[Index].Caption .. "\\" .. I .. '.BAK', '..\\' .. Apeopex.UserButtons[Index].Caption .. "\\" .. I;
local Compiled = '..\\' .. Apeopex.UserButtons[Index].Caption .. "\\" .. I, '..\\' .. Apeopex.UserButtons[Index].Caption .. "\\" .. I;
.
.
.
local Finished, Error = CopyFile(Compiled,Backup);
.
.
.
OutFile:write(string.dump(assert(loadfile(Backup)) ));
I hope that are all changes i made.

EDIT.: Nevermind this post i was reacting to post 10 posts before

Last edited by delirius; 08-23-2011 at 04:55 PM.
Reply With Quote

  #23  
Old 08-23-2011, 05:00 PM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Default the c is closed

I guess the c thing is closed. It's working in the ADK but closed on the player.
Quote:
ou must compile it to a dll , if you want i could probably send a compiled version, ( I have been using c modules in my code for a while ).
if you have found a workaroaund for c modules on the player please share it

Last edited by Kalle Kula; 08-23-2011 at 05:16 PM.
Reply With Quote

  #24  
Old 08-23-2011, 06:42 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Quote:
if you have found a workaroaund for c modules on the player please share it
Unfortantly, dynamic libraries are disabled on the player (after a bit of testing). I have also tried linux libraries with no luck.
Reply With Quote

  #25  
Old 08-24-2011, 01:04 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Quote:
Originally Posted by jbob182 View Post
I can, here is the code i use:

Code:
require "lfs"
lfs.mkdir (lfs.currentdir () .. "/HelloWorldDir")
myfile = io.open("/HelloWorldDir/TextFile.txt","w+")
myfile:write("Hello World!")
io.close(myfile)
After testing around, you would only get that error if the dir didnt exist, so you must be missing this part :lfs.currentdir () ..
Shit, it wasn't made in the right folder...

How would I go about makign the directory in another folder? Right now it only has the backup-app's folder's path, but when I try to use lfs.chdir(path) I get an "invalid Argument" error, I must have the wrong syntax of my path... But not even giving it
'c:\\Creative\\ZEN X-Fi2\\Applications\\' .. Apeopex.UserButtons[Index].Caption
as a path worked...

This is what I do now to create it, but I get Invalid Argument error:
Code:
local BackupFolder = '..\\' .. Apeopex.UserButtons[Index].Caption .. '\\Backup'
  print("creating: " .. BackupFolder)
  local Folder, Error = lfs.mkdir(BackupFolder) --Create backup directory
  if Folder == nil then
	print(Error)
  else
	print("Succes at creating directory")
  end;
EDIT:
I fixed it, I changed the way I stored the path like this:
Code:
local BackupFolder = string.gsub('..\\' .. Apeopex.UserButtons[Index].Caption .. '\\Backup',string.char(13),"")
i knew I had missed something... xD
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^

Last edited by Habhome; 08-24-2011 at 02:48 PM.
Reply With Quote

  #26  
Old 08-24-2011, 03:01 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Here is my modified version of the LUAC.

This one compiles the original file, keeping its name.
It backs up the files in a folder named "Backup" inside of the application's own folder.
Never overwrites a backup if one exists already, instead it names it with the ending (1), (2)...

Disclaimer: I am not the creator of the original code, I have just modified it to adhere to user-feedback. This is not yet tested with multiple .LUA files in a project, but it should work just as well as the original software.

Before you try it for the first time, make a manual backup just to be sure!
Attached Files
File Type: zip LUAC - Mod by Habhome.zip (91.5 KB, 9 views)
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^

Last edited by jbob182; 08-24-2011 at 03:08 PM.
Reply With Quote

  #27  
Old 08-24-2011, 03:08 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

I will run a test on Pingus with this version and edit this post to say how well it works.
---------------------------------------------------------------------------------------

I ran it and it works perefectly on multiple files, HOWEVER it will not find much deeper files such as

Pingus X-Fi2\data\campaign\Tutorial Island\Tutorial Island.lua

Use the lfs search option for dirs, and then search each dir for .lua

Last edited by jbob182; 08-24-2011 at 03:13 PM.
Reply With Quote

  #28  
Old 08-24-2011, 11:34 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Quote:
Originally Posted by jbob182 View Post
I will run a test on Pingus with this version and edit this post to say how well it works.
---------------------------------------------------------------------------------------

I ran it and it works perefectly on multiple files, HOWEVER it will not find much deeper files such as

Pingus X-Fi2\data\campaign\Tutorial Island\Tutorial Island.lua

Use the lfs search option for dirs, and then search each dir for .lua
Ah yeah, the original LUAC didn't support going deeper in the folder-structure, and I didn't think of changing that. I'll see what I can do
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 05:26 PM.