|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 20, 2010 11:54 am
#FILE |
So, what I'm understanding from the helpfile is that I have to use the CMUD directory? I can't direct it anywhere else? Can I use sub-folders in the CMUD directory?
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu May 20, 2010 1:35 pm |
No, you can't direct it anywhere else. If Cmud allowed you to access files elsewhere in the system, a malicious hacker could write and distribute a package that could do bad things to your system. It is basic security to limit #FILE access to the Cmud directory only. I think you can use subfiles within the Cmud directory, as long as it is not a .exe, .hlp, or mud file.
|
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 20, 2010 2:01 pm |
I'm aware of the potential "problems" I was just wondering if it had been changed as it's awfully limiting for those who of us who aren't particularly worried about malicious hackers. It would be nice to have an option to turn that limit off (on by default of course) so that we could have more freedom with it. Either way, it would be interesting to know if we're supposed to be able to do sub-directories, because I couldn't do them when I tried earlier.
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu May 20, 2010 3:02 pm |
You can use subfolders... I do...
Code: |
#FILE 1 "C:\Users\Charneus\Documents\My Games\CMUD\Aardwolf\Logs\INFO.txt" |
You can even shorten that up to:
Code: |
#FILE 1 "\Aardwolf\Logs\INFO.txt" |
You can even go outside the CMUD directory...
Code: |
#FILE 1 "C:\Testing.txt"
#WRITE 1 "Testing"
#CLOSE 1 |
works for me. Keep in mind that the folders you are writing to have to already exist (that is, CMUD will not create new folders for you).
Charneus |
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 20, 2010 4:18 pm |
No idea why it's not working for me then. I'll... keep trying.
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Thu May 20, 2010 4:39 pm |
I know I should remember but which versions of windows do you guys have?
Vista or windows 7 have a more strict access system that does Xp or previous versions.
That said the differences are normal and expected if for instance charneus has XP and chamenas has Vista or Windows 7.
If you DO have windows Vista or 7 chamenas you can give users read and write access to ANY specific folder within windows and then Cmud should be able to write to it with a path as charneus mentioned. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu May 20, 2010 6:04 pm |
I have Vista, and I've been applying write access as I go along. I hate it, but I'll double check to see if I have.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu May 20, 2010 8:30 pm |
If you could turn it off, then you could turn it off for someone else who was using your package. It would always be a security risk--there's no way around that. Therefore, it will never be changed.
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu May 20, 2010 8:44 pm |
For what it's worth, I have Windows 7. ;) Don't have a problem writing to my program files directory, either, but I agree, it could be permission access problems.
Charneus |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu May 20, 2010 10:56 pm |
By default, files created with the #FILE command are stored in the MUD character folder for your session within the User Data Files directory chosen at install time.
Packages should NEVER attempt to write outside of this directory structure.
You can use subdirectories like this:
Code: |
#FILE 1 "Logs\INFO.txt" |
although as already mentioned, CMUD will not create the directory if it doesn't exist.
Never write to the "Program Files" directory. Vista and Win7 restrict this by default. If a program tries to write to this directory, it might fail, or it might work and instead of writing to that directory, Windows ends up creating a "compatibility directory" for the files, which is difficult for some users to locate. If it succeeds then you have your Windows permissions set differently from the default of most users. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu May 20, 2010 11:12 pm |
Right, I do have my permissions set differently from others. I don't personally store anything into my program files directory anyway. Only very rarely do I create a file outside of CMUD's game directory, though... I tend to like my stuff in a centralized location. :P
Charneus |
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri May 21, 2010 12:19 am |
I just want to Write to stuff in a folder I specifically have for the game. If I can get that to work, lovely. But a subdirectory within the CMUD folder is fine too, at least it will be organized that way.
|
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri May 21, 2010 3:15 am |
Every time I "right+click" and uncheck the "Read-Only" and hit Apply. I close it, re-open it, and it's "Read-Only" again.
|
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri May 21, 2010 4:04 am |
In this particular instance I'm not even using #WRITE, I'm using #READ and it isnt working.
Code: |
#FILE 1 "\"@_c_char"\"@_outfit.current".txt"
$_lines=%filesize( 1)
#LOOP $_lines {
#READ 1 %i
#wait 400
}
#send "@"
#show "Description Updated!"
#T- new-outfit
|
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri May 21, 2010 2:20 pm |
Try using explicit concatenation instead of implicit:
Code: |
#FILE 1 %concat("\",@_c_char,"\",@_outfit.current,".txt")
|
|
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri May 21, 2010 2:48 pm |
I could, but I also simply tried a straight string
Code: |
#FILE 1 "\characternamehere\outfitname.txt"
|
And it still failed, I forgot to mention that. Regardless, I respect your advice and tried the %concat to no avail. It's not #WRITE so I'm not sure if it would have to do with folder permissions, but if I'm doing everything like I'm supposed to, I'm not sure what else might be wrong.
Code: |
#FILE 1 @_c_char"-"@_outfit.current".txt"
$_lines=%filesize( 1)
#LOOP $_lines {
#READ 1 %i
#wait 400
}
#send "@"
#show "Description Updated!"
#T- new-outfit
|
Works just fine, the problem is that it's less organized and more difficult to manage than folders. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri May 21, 2010 3:50 pm |
Oh, the problem is your path. You used a path starting with \, which means it is not in the Cmud folder. As noted above, #FILE won't do that. Your path cannot start with a backslash. If the folder "characternamehere" is a subfolder in the Cmud folder, then you want
Code: |
#FILE 1 "characternamehere\outfitname.txt"
|
|
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri May 21, 2010 9:25 pm |
I've tried it without that too though, but I'll try again later when I get the chance.
|
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri May 21, 2010 10:50 pm |
My problem? I COMPLETELY forgot that I was actually using two levels of sub-folders, and forgot to put the parent folder in.
|
|
|
|
|
|