Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java creation of Temporary files  (Read 956 times)
0 Members and 1 Guest are viewing this topic.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Posted 2004-07-26 23:32:52 »

I have an app that uses the File.createTempFile method, which has always worked for me, but refuses to work in Debian Sad. It seems that this method doesn't work on Debian (it generates "permission denied" whenever you try to use the file you've created).

[Presumably this is either a bug in the JVM (not working with the OS as it should) or in Debian (being over-zealous and some smart-arse making temporary files not work the way they are supposed to in a standard OS, possibly braking POSIX compliance or something like that?), but I know it works fine on both windows and linux. EDIT ... or some other app, completely unrelated, that I happened to run previously from the same BASH and which set the umask to something magnanimous and didn't restore it...although I have NO idea why this breaks the /tmp directory!]

Now I'm stuck trying to think of a workaround: how to get temporary files to work when the OS gives permission-denied every time you open them. This is for an app that creates thousands of files on every run, as a form of primitive file-memory-mapping.

The only thing I can think of is to re-write it from the ground up to use NIO mem-mapping - but then, we already *know* that that part of NIO doesn't work properly at the moment, so... ARGH!

In case someone can think of an easier refactoring (or better design), the basic process is this:

1. recursively split a very very large (hundreds of megabytes) input file into smaller sub-sections using a computationally intensive algorithm (i.e. it's not something plain and simple like a sort)

2. use those sub-sections as source data for running a variety of algorithms. Most algorihtms "cherry-pick" a small subset of the sub-sections to work on (hence this gives us a fast, effective, simplistic sort of virtual memory mgmt). Some algos work on all sub-sections, but use the tree-structured grouping to deal with them in large chunks. Various magic goes on to order algorithm execution to maximise use of any given section whilst it's in memory.

3. delete everything, and return to 1, using a DIFFERENT recursive split algorithm, and a different set of algos in 2 (although many will be the same as ones used previously, there are also many that aren't).

4. ...continues until all splitting algos are complete...

With 2 or 3 splitting algos and a dozen or so processing algos this works fine and fast. It needs to scale to 20-odd splitters and 30-odd processors, but only over time (As I get around to adding the extra algos).

malloc will be first against the wall when the revolution comes...
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #1 - Posted 2004-07-26 23:36:44 »

OK, I've solved the Debian part, but perhaps my design is still wrong. Any better ideas?

FYI Debian problem was because the umask had been set temporarily to "0777" and not unset. (PS is there a way to set umasks for particular local directories on linux?).

malloc will be first against the wall when the revolution comes...
Offline AndersDahlberg

Junior Duke





« Reply #2 - Posted 2004-07-31 13:58:37 »

?? chmod ??

Maybe I'm way off here  Grin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #3 - Posted 2004-07-31 15:00:40 »

Quote
?? chmod ??

Maybe I'm way off here  Grin


Sorry, I mean so that any file copied in from anywhere else gets converted to those attributes too. My local copy of chmod only seems to affect new files created there. ?

malloc will be first against the wall when the revolution comes...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (44 views)
2014-10-16 15:22:06

Norakomi (34 views)
2014-10-16 15:20:20

lcass (38 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (68 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!