[Actual coding thread]A simple moving application

Everything related to programming.
Mgalekgolo
Commando
Posts: 2589
Joined: Thu Jun 24, 2010 6:36 am

[Actual coding thread]A simple moving application

Post by Mgalekgolo » Tue Oct 11, 2011 8:54 pm

I got xcode and shit for programming, and I want to make an application, cross-platform (If I can only do windows thats fine, its not really for a mac application), that basically moves a file to another location. I would like some tips on what I should write this with, how I should do it, and if at all possible a quick tutorial. I have basically no coding experience except for a small amount of hex and some java from modding minecraft. Oh and HTML from a website design class I took.
Yarok wrote:There may be a giant dildo protruding from your forehead.
Image

Sparky
Delta Force
Posts: 4194
Joined: Wed Mar 31, 2004 8:59 pm
Location: New Jersey, USA
Contact:

Re: [Actual coding thread]A simple moving application

Post by Sparky » Wed Oct 12, 2011 6:24 am

Moving files is the same as renaming their pathnames.
So you get the path of a file that the user opens (or that is found by the program in other ways) and you change the path to include another directory. If that directory doesn't exist, it's created.
If you rename a directory, it will actually change that directory's name. The same principle applies to files.

Get the file's path and insert it into a variable.
Redefine the variable when you write to the filesystem.
Either you are groping for answers, or you are asking God and listening to Jesus.

Mgalekgolo
Commando
Posts: 2589
Joined: Thu Jun 24, 2010 6:36 am

Re: [Actual coding thread]A simple moving application

Post by Mgalekgolo » Wed Oct 12, 2011 6:46 pm

How would I have the user select the install folder and have the game folder [in this case ( I don't remember the windows format so if I do something wrong please correct it. "C:/Program files/JAN_ Realms (Demo 1.1)/Graphics/Characters/[$Male.png/$ralph.png]". I think I wrote that right. Well I want to program it so it doesn't need to be in program files, also copying 1 file, renaming it to the 2 files (the two are the same, but one seems not to do anything and the other actually changes the sprite, but I still want to replace both) and backing up the existing files [$male and $ralph].
Edit: I keep trying to find this on google but all I see is how to move a file to an external drive and other dumb shit. Sparky im not sure how to implement that. If someone could maybe write the code [in java maybe? something cross platform] With an example path (not the path to the game, maybe C:/Example/example/example) ect. Then I would analyze that code and test some things, then I would understand that part of the coding language. And that's how I learned what I know of java (very little, but its more than I ever though I would <_<).
Yarok wrote:There may be a giant dildo protruding from your forehead.
Image

Monoman
Site Admin
Site Admin
Posts: 2662
Joined: Sat Aug 16, 2003 11:26 pm
Location: Planet Bob
Contact:

Re: [Actual coding thread]A simple moving application

Post by Monoman » Thu Oct 13, 2011 2:11 pm

Since you are looking to move files in Windows, why not just create a bat file that moves them?
Kansas....Like Paris Hilton: White, Flat, and Easy to Enter. -- Conan O'Brien

Masturbation is like procrastination, they're both great until you realize your screwing yourself.

MGM Discord | MGM Chat
MGM Sig

Mgalekgolo
Commando
Posts: 2589
Joined: Thu Jun 24, 2010 6:36 am

Re: [Actual coding thread]A simple moving application

Post by Mgalekgolo » Thu Oct 13, 2011 6:14 pm

I'm not sure how to make a .bat to move files. That would work though, providing someone can tell me how.
Yarok wrote:There may be a giant dildo protruding from your forehead.
Image

Excend
Commando
Posts: 2791
Joined: Sun May 06, 2007 3:27 am
Location: SiK x Gh0sTs Rehauled.
Contact:

Re: [Actual coding thread]A simple moving application

Post by Excend » Thu Oct 13, 2011 6:29 pm

Code: Select all

move /-y "Directory\file" "New_Directory"

pause
The -y prompts an error if there is a duplicate file, use /y if you're over writing files.
TaxiService wrote:Roses are red
Violets are blue
What a shitty thread
Fuck all of you.

Mgalekgolo
Commando
Posts: 2589
Joined: Thu Jun 24, 2010 6:36 am

Re: [Actual coding thread]A simple moving application

Post by Mgalekgolo » Thu Oct 13, 2011 6:53 pm

Ok, so I create a document in notepad and save as bat?
Went and did that. Thanks man, it works. Now If I could have the user choose the file to move's location...
Yarok wrote:There may be a giant dildo protruding from your forehead.
Image

Excend
Commando
Posts: 2791
Joined: Sun May 06, 2007 3:27 am
Location: SiK x Gh0sTs Rehauled.
Contact:

Re: [Actual coding thread]A simple moving application

Post by Excend » Fri Oct 14, 2011 1:21 am

What do you mean?
TaxiService wrote:Roses are red
Violets are blue
What a shitty thread
Fuck all of you.

Mgalekgolo
Commando
Posts: 2589
Joined: Thu Jun 24, 2010 6:36 am

Re: [Actual coding thread]A simple moving application

Post by Mgalekgolo » Fri Oct 14, 2011 5:46 am

Basically It would be nice if I could have the user type the path of the file that is being moved instead of it being a single path.
Yarok wrote:There may be a giant dildo protruding from your forehead.
Image

Sparky
Delta Force
Posts: 4194
Joined: Wed Mar 31, 2004 8:59 pm
Location: New Jersey, USA
Contact:

Re: [Actual coding thread]A simple moving application

Post by Sparky » Fri Oct 14, 2011 6:41 am

You could probably either change the properties of one of these files or drag the file to be moved onto the .bat file. Research .bat file commands.
Either you are groping for answers, or you are asking God and listening to Jesus.

Excend
Commando
Posts: 2791
Joined: Sun May 06, 2007 3:27 am
Location: SiK x Gh0sTs Rehauled.
Contact:

Re: [Actual coding thread]A simple moving application

Post by Excend » Fri Oct 14, 2011 7:23 am

Mgalekgolo wrote:Basically It would be nice if I could have the user type the path of the file that is being moved instead of it being a single path.
To save a string to a temporary file.

Code: Select all

ECHO ←[13;0;64;13p
COPY CON USRINPUT.TMP
ECHO ←[13;13p
CLS
All you really need is the copy con, but if you use that you have to use f6 + enter to send a line of text.
TaxiService wrote:Roses are red
Violets are blue
What a shitty thread
Fuck all of you.

Mgalekgolo
Commando
Posts: 2589
Joined: Thu Jun 24, 2010 6:36 am

Re: [Actual coding thread]A simple moving application

Post by Mgalekgolo » Fri Oct 14, 2011 5:47 pm

I don't see how I could set a path with that ^.
What sparky said (drag and drop the file) seems good. I basically want to have a path set for destination but an open ended original file. The .bat I have now works well enough though.
Yarok wrote:There may be a giant dildo protruding from your forehead.
Image

Excend
Commando
Posts: 2791
Joined: Sun May 06, 2007 3:27 am
Location: SiK x Gh0sTs Rehauled.
Contact:

Re: [Actual coding thread]A simple moving application

Post by Excend » Fri Oct 14, 2011 8:13 pm

If you want to drag and drop a selected file onto a direct file path can't you just create an alias?
TaxiService wrote:Roses are red
Violets are blue
What a shitty thread
Fuck all of you.

Mgalekgolo
Commando
Posts: 2589
Joined: Thu Jun 24, 2010 6:36 am

Re: [Actual coding thread]A simple moving application

Post by Mgalekgolo » Fri Oct 14, 2011 8:43 pm

If I understand you right that would seem to require knowledge of where the destination directory is, which is what im trying to avoid.
Yarok wrote:There may be a giant dildo protruding from your forehead.
Image

Excend
Commando
Posts: 2791
Joined: Sun May 06, 2007 3:27 am
Location: SiK x Gh0sTs Rehauled.
Contact:

Re: [Actual coding thread]A simple moving application

Post by Excend » Sat Oct 15, 2011 6:24 am

I'm still very confused about what exactly you're trying to do... Here's what I have: You want to be able to move any file you want to a specific directory, the directory being the same everytime, but with the user having no actual knowledge of where the directory is?
TaxiService wrote:Roses are red
Violets are blue
What a shitty thread
Fuck all of you.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests