Jump to content


Photo

Few Simple Questions...


  • Please log in to reply
9 replies to this topic

#1 tayior7

tayior7

    X-S Senior Member

  • Members
  • PipPip
  • 276 posts

Posted 20 January 2004 - 01:15 AM

ive come across a few problems while trying to write a few scripts, and here they are...

1. copying (or deleting) a file with a space in its name- i tried puting quotes around it but that just gives me an error
here are i few things i tried...
CODE

Copy D:blah blah.xbe C:
Copy "D:blah blah.xbe" "C:"
Copy "D:blah blah.xbe" C:


2. RmDir doesn't seem to be working
things i tried...
CODE

RmDir C:test
RmDir C:test
RmDir C:test yes
RmDir C:test true
RmDir C:test yes
RmDir C:test true


3. i dont think Delete can use wildcards.

4 last question, if i try to copy a file somwhere and its already there i get an error (duh), how can i make it overwrite the file?


any help on the above questions would be greatly appreciated!
thanks!

Edited by tayior7, 20 January 2004 - 01:18 AM.


#2 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 20 January 2004 - 02:22 AM

QUOTE (tayior7 @ Jan 19 2004, 09:15 PM)
ive come across a few problems while trying to write a few scripts, and here they are...

1. copying (or deleting) a file with a space in its name- i tried puting quotes around it but that just gives me an error
here are i few things i tried...
CODE

Copy D:blah blah.xbe C:
Copy "D:blah blah.xbe" "C:"
Copy "D:blah blah.xbe" C:



Well it would have to be quoted (otherwise, there's no way to tell what the argments are) , but I don't know why it wouldn't work for you quoted.


QUOTE

2. RmDir doesn't seem to be working
things i tried...
CODE

RmDir C:test
RmDir C:test
RmDir C:test yes
RmDir C:test true
RmDir C:test yes
RmDir C:test true


Does the directory possibly contain files that are opened?


QUOTE

3. i dont think Delete can use wildcards.


Correct (Sorry about that) - it calls the API function DeleteFile(). I may dig back in there and use wildcard searching. You could always walk the wildcards through...

QUOTE


4 last question,  if i try to copy a file somwhere and its already there i get an error (duh), how can i make it overwrite the file?


any help on the above questions would be greatly appreciated!
thanks!


Well, the safe way is to check the existence first. More tweaking for the ActionScripting, I guess. Also, I will hopefully have time to add error handling to the ActionScripting.

#3 tayior7

tayior7

    X-S Senior Member

  • Members
  • PipPip
  • 276 posts

Posted 20 January 2004 - 02:29 AM

thanks alot for the quick response,
but about the quotes and spacing,
if i do this:
CODE

Delete "C:\blah blah.xbe"

the script will run without an error, but it wont delete the file. I know of other people with the same problem too.

and i know that none of the files that are trying to be deleted are in use because they are dummy files i put on there to test all of this.

im so lost sad.gif

#4 geniusalz

geniusalz

    Team MXM

  • Head Moderators
  • PipPipPipPipPip
  • 1,827 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 20 January 2004 - 02:37 AM

In scripts, blackslashes are 'escape characters' and need to be doubled when inside quotes.

Another independent issue is that this board also uses backslashes for that, and they need to be doubled up to show.


Therefore, the command needs to be:
Delete "C:\\blah blah.xbe"

not
Delete "C:\blah blah.xbe"


*I understand you might have tried doubling up in the script, but the board reduced it to one slash, or you might have doubled up to show one in the board. It's confusing, I know smile.gif

EDIT: But I DID double the backslashes! huh.gif

Edited by geniusalz, 20 January 2004 - 05:56 AM.


#5 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 20 January 2004 - 10:34 AM

Ah yes... I forgot that important detail (You guys are more experienced at using ActionScript than I am - and I wrote the damn code behind it!!)

Yes, backslash is an "escape" character, so you need to double it up, just like when writing C/C++ code string constants.

That's so you can include things like quotes in the quoted strings:

"Example of \"quotes\" text within a quoted argument"

So when doing a backslash alone, you need to double it up (since it is, itself, an escape sequence):

"C:\\Somepath"

#6 tayior7

tayior7

    X-S Senior Member

  • Members
  • PipPip
  • 276 posts

Posted 20 January 2004 - 09:55 PM

thank you this will help ALOT!
o yea and another question to BJ- will there, or is there a way to make custom boot up animations (the matrix effect)?
thanks again

#7 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 21 January 2004 - 02:09 AM

QUOTE (tayior7 @ Jan 20 2004, 05:55 PM)
thank you this will help ALOT!
o yea and another question to BJ- will there, or is there a way to make custom boot up animations (the matrix effect)?
thanks again

The bootup stuff is hard coded, because it happens before anything is loaded. There are several there, but I will be doing more in the future.

#8 tayior7

tayior7

    X-S Senior Member

  • Members
  • PipPip
  • 276 posts

Posted 22 January 2004 - 12:53 AM

ok hopefully this is my last question-
Is there any special thing u need to do to copy from drive D: ?
What exactly does MOUNT D: do?
i tried copying a folder off of a disc (d:) and it would start copying the contents then would stop and give me an error. Hopefully its just reading so extremely slow it quit? It is burned on a low quality cdrw, could that be the problem, its just reading so slow it quits?

#9 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 22 January 2004 - 12:58 AM

QUOTE (tayior7 @ Jan 21 2004, 08:53 PM)
ok hopefully this is my last question-
Is there any special thing u need to do to copy from drive D: ?
What exactly does MOUNT D: do?
i tried copying a folder off of a disc (d:) and it would start copying the contents then would stop and give me an error. Hopefully its just reading so extremely slow it quit? It is burned on a low quality cdrw, could that be the problem, its just reading so slow it quits?

It's probably a media problem.

MOUNT <DRIVE> is used to mount the "normal" partition to the drive letter, but this is usually already done, except when a format is required.

#10 tayior7

tayior7

    X-S Senior Member

  • Members
  • PipPip
  • 276 posts

Posted 22 January 2004 - 01:14 AM

thanks again!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users