Working with files
hi everyone,
i have a problem, i have one app which calls another java app using runtime functions.
Ok the thing is that i need that one app will write in a file and the other one read and delete the lines read from the same file almost in a syncrhonous way, it means, both app use the same file but in different ways, anyone knows how to do it?
Also I though it could be done with pipes but even not a clue. Thanks
Under Unix there are named pipes. A named pipe is in the file system, hence it can be opened as a file. The reader is blocked until data is there to read or the writer is blocked until there is a reader to read the data. Once data is read, it is gone.
Similar Messages
-
I worked with files in LR that were originally on my C drive, then were moved to an external HD for storage. I now want to do some more work on those files (which have the same file name as on the C drive). I plugged the drive into my computer and it shows in LR under folders as the F drive and the little green light is on, but LR is showing only the first 6 files and not the remaining 200 or so. How do I expand the F folder to expose all files?
I worked with files in LR that were originally on my C drive, then were moved to an external HD for storage. I now want to do some more work on those files (which have the same file name as on the C drive). I plugged the drive into my computer and it shows in LR under folders as the F drive and the little green light is on, but LR is showing only the first 6 files and not the remaining 200 or so. How do I expand the F folder to expose all files?
-
How to work with files in folders on Application/Presentation Server
Hi,
I am working on interface program in which files are populated in folders in application/presentation server in the format 'ABCsy-datumsy-uzeit.txt'(e.g.ABC20051022161450.txt,ABC20051022161455.txt ) in directory c:\temp.
I want to sort all these files and read in sorted manner.
can anybody help me out in this.
waiting for reply.
thanks & regards,
NitinHi,
This logic will work for files on presentation server,
DATA: l_count TYPE i,
l_filename TYPE string,
t_files TYPE string OCCURS 0 WITH HEADER LINE,
BEGIN OF t_files_sorted OCCURS 0,
file_prefix(3),
file_date LIKE sy-datum,
file_time LIKE sy-uzeit,
file_extension(4),
END OF t_files_sorted,
t_text TYPE TABLE OF w3html.
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = 'C:\Temp'
FILTER = '*.txt'
files_only = 'X'
DIRECTORIES_ONLY =
CHANGING
file_table = t_files[]
count = l_count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT t_files.
t_files_sorted = t_files.
APPEND t_files_sorted.
ENDLOOP.
SORT t_files_sorted BY file_date file_time.
LOOP AT t_files_sorted.
CONCATENATE 'C:\Temp\' t_files_sorted INTO l_filename.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = SPACE
HEADER_LENGTH = 0
IMPORTING
FILELENGTH =
HEADER =
changing
data_tab = t_text[]
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
others = 17.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*****Your processing here..
ENDLOOP.
Also, use the FM that MAX has if you have to work with files on application server by replacing code in the above logic at appropriate places, like replace
cl_gui_frontend_services=>directory_list_files
with the corresponding fm
and replace cl_gui_frontend_services=>gui_upload
with OPEN DATASET...
CLOSE DATASET...
logic.
Hope this helps..
Sri
Message was edited by: Srikanth Pinnamaneni -
How to work with file system in linux within a JSF app?
I use this line in my backing bean to log some events:
FileHandler fhxml = new FileHandler("../webapps/MyWebApp/Log/MyWebAppLog.xml", append);
fhxml.setFormatter(new XMLFormatter());That works fine in windows but when I deploy it in my Tomcat 6 in linux It doesn't work. How can I work with file system in linux?You should never use relative paths to access the filesystem. The path would be relative to the current working directory which is not per se the same in all environments. To convert a relative web path to an absolute file system path, you need ServletContext#getRealPath(). Use this absolute file system path in the java.io stuff. In a JSF application on top of Servlet API you can get the underlying ServletContext by ExternalContext#getContext().
Alternatively, if the file is located in one of the default paths of the classpath or if its path is added to the classpath, you can also just use ExternalContext#getResource() or even #getResourceAsStream() using just the file name. -
Cannot print "working with files and folders htm
When I try to print "Working with files-and-folders" from a Google search, it only prints part of it. I have changed my destination folder to no avail. Thank you or any help, Jack Menendez
What's the best method for moving all my nonsystem related stuff over to this new driveIan has provided you with the best solution, SuperDuper.
But if you have a 250 GB external, you really ought to clone your entire system,(only about 3 GB) so you have a backup.
I keep mine with a complete clone of my internal, that way it is easy to boot from the external and run utilities like Disk Utility, TechToolPro, DiskWarrior, etc. on the internal and vice versa.
If you run into a problem with say Preferences and don't know which one is the troublemaker, just trash the whole pref folder and use the good one from the clone. Font problem, same deal. And, if diaster ever strikes, you can just boot up from your external and keep right on working - fix the internal when you have time.
That's my 2 cents anyway
-mj
[email protected] -
Hello!
Can anyone help me. How can I API in Java Technology for files to find ?don't uite understand your question.
here's the location of java API for File class, for working with File and Directory..
http://java.sun.com/j2se/1.3/docs/api/java/io/File.html
for reading and writing..you may want to look at th eio package for classes such as
Reader, FileReader, BufferedReader, Writer, FileWriter, BufferedWriter
here's java API
http://java.sun.com/j2se/1.4.2/docs/api/ -
Managing spaces when working with files
Hi, how can I work with files on windows on paths thats have blank spaces like "Documents and Settings", I used getResource().getFile() and writting the path but it always fails!
The FileOutputStream always thorws the exception FIleNotFoundException.
I tried the path with blank spaces and tried with %20 but always is the same.Are you saying that OutputStream os = new FileOutputStream("C:/Documents
and
Settings/AAD/workspace/MobileServer/bin/Configuracion/
conexiones.omt");throws an exception? If so, what exception?Exactly it throws an Exception.
java.io.FileNotFoundException: C:\Documents and Settings\AAD\workspace\MobileServer\bin\server\Configuracion\conexiones.omt (El sistema no puede hallar la ruta especificada)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
at server.tcp.GestionTCP.guardar(GestionTCP.java:118)
at server.tcp.GestionTCP.mouseReleased(GestionTCP.java:89)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) -
Will the current plugins for Sigma DP1/2 RAW files work with files from the DP1/2 Merrill cameras? And if not, is Adobe developing plugins for these cameras?
Not sure what plugins you mean, Hornet - Lr doesn't rely on plugins to read new cameras.
If you mean the Adobe Camera Raw (ACR) plugin - that's for Photoshop, not Lightroom. Lr has the same functionality as ACR, but it's hard-coded into the program, so if you're looking for support for a new camera, you need to wait for a new version of Lr.
And nobody here can say when Lr support for a given camera will happen.
Hopefully someone with a Merrill will be able to chime in about whether its files work with the current Lr. -
Freeze up after working with files copied to DVD. A105-4274 Satillite
When working with files copied to a DVD, when ejecting my computer locks up. Have to turn it off manually and restart.
Can use anyother type of DVD, and this does not happen. Only useing DVD with files written to it. This only happens when i work with the files and then eject the DVD. Please I need help
Solved!
Go to Solution.ebonykaneezer wrote:
When working with files copied to a DVD, when ejecting my computer locks up. Have to turn it off manually and restart.
Can use anyother type of DVD, and this does not happen. Only useing DVD with files written to it. This only happens when i work with the files and then eject the DVD. Please I need help
I'm guessing that you are just pressing the eject button on the drive. Don't do that.
Quit the application that you are using to work with the files. Then open Windows Explorer, right-click the CD/DVD drive and click on 'Eject'. -
Working with files on mobile devices
Hi everybody,
at the moment we are running a Vibe 3.4 server which is used most of the time by normal pc clients with the users using the browser or the Vibe desktop client to connect. Now we are getting a tablet project using Vibe more via mobile access (Android based) . The Problem now is, I can do many things with my mobile Vibe access or the Vibe App but I havent figured out how to work with my files stored in Vibe while accessing them via a mobile device.
Is there any possibility to open and work with the files/attachments?
If no, is this a planned feature for the future?
Any help, hint or trick is is greatly appreciated
Regards,
Andreasastock,
It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.
Has your problem been resolved? If not, you might try one of the following options:
- Visit http://www.novell.com/support and search the knowledgebase and/or check all
the other self support options and support programs available.
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://forums.novell.com)
Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.novell.com/faq.php
If this is a reply to a duplicate posting, please ignore and accept our apologies
and rest assured we will issue a stern reprimand to our posting bot.
Good luck!
Your Novell Forums Team
http://forums.novell.com -
LabView limitation : working with File 2 Go
Hi,
I'm acquiriring data in real time from several cards et high frequencies (102400 Hz).
The acquisition can last 10 hours and so the file can have size like 150 Go.
All labview file functions work with int32 to set offset, size of file... in byte.
How Can I do ?? (example : I have a 6 Go file : how can I know it's size with labview ???)
Eddy DUCHENE
12 F Chemin de Boutary
69300 CALUIRE ET CUIRE
[email protected]educhene wrote:
I'm using a loop with Read Vi to seek in the file. It works well, But When my file is greater than 2 GB, I got a memory error (mémoire insuffisante pour terminer l'opération) when I try to read for example 263000 singles data.
This error appears when I want to read my 263000 values (not when seeking).
I don't understand why, because it runs well with a file less than 2 Gb even if I want to read more values.
Please find attached the example vi. Choose a file and run it : if your file size is less than 2 Gb (but have enough datas (ex : file size 10 Mb), it's ok, but if you run it with a file size more than 2 Gb you have the memory error.
Help please ...
As has been mentioned if you go to http://www.openg.org you will find in the File function Toolkit a library Large File Access, which works only on Windows as it calls directly into the WinAPI. Unlike other responses who said that the 2GB limit is a limit of the OS, Windows is actually able to work with larger file offsets. But LabVIEW currently does not make use of this option. The OpenG Large File functions mimic the LabVIEW low level FileIO functions but use a double precision floating point for all offset related parameters due to the lack of int64 support in LabVIEW.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Disappearing hard drive and sudden inability to work with files from my camera.
I was installing the photoshelter plugin and noticed my external hard drive was not displayed. I had to import the whole drive again. Now when I try to import from my cards I get the error that this version of LR cannot work with my camera files. It has been working with them for years so what's up?
It's a long shot, but if nothing more concrete is posted, as you had just installed Photoshelter, have you tried uninstalling it and seeing whether this makes a difference.
-
Applet showDocument work with file protocol?
Hi,
I have a signed applet (using signtool and Thawte certification) with full permission. Now I want to display a local text file from the browser. So here is the code I am using:
try
//test file protocol
applet.getAppletContext().showDocument(new URL("file:///c:/test.txt"),"_blank");
//test http protocol
applet.getAppletContext().showDocument(new URL("http://java.sun.com"),"_blank");
catch(Exception e)
e.printStackTrace();
But noting happens to display the file in IE or Netscape(win2k, IE 6 and netscape 7.1), not even an exception is thrown. The http page does open in a new browser. In IE I can set security/local intranet/sites to make file display work. But it's not a good idea to ask every client machine to change the browser settings to make this work.
Does anyone know why showDocument does not work for file protocol? Have anyone solve this problem?
Thanks a lot!Try this:
try
//test file protocol
applet.getAppletContext().showDocument(new URL("file:\\\\c:\\test.txt"),"_blank");
//test http protocol
applet.getAppletContext().showDocument(new URL("http://java.sun.com"),"_blank");
catch(Exception e)
e.printStackTrace();
It works for me... -
Help working with File() objects
Hi,i'm sorry for my not-so-perfect English.
I'm working with java.io.File object, to use and know the contents of a folder.
But if i try to use the function list() on a folder that is the first in my hard drive (For example: C:\Test on windows, or /usr on unix), and try to get the Parent...i receive null.
This is a regoular way,in my opinion; But i have a problem: i'm working at a Java File Manager, and i'd like to LIST all my hard driver present in my computer (ie. C:,D:, E:) but i don't really know how to do...!!
On UNIX, i can resolve this problem using a list() on /mnt folder, for mounted drive...but on Windows...how can i!?
Thanks for the answers...Hi,
Take a look at:
File.listRoots()
Kaj -
How To Work With File Path in Forms
Hi
I have one button on form i use it to call microsoft word when i finsh work i want to save my word file then open save DIALOG box to save that file
i want to take that path from save dialog box to text item in my form
how can i do this ?If you are using Forms version 9.x or newer, you can use WebUtil to open Word on the client machine, Save the Word file, then do whatever you'd like with the path where the file was saved. If you are using an older version in client/server mode and not web, you would do something similar ony you would use OLE from within the form to call Word.
In short, we cannot offer much information because you did not provide enough detail about what you are doing, how you are doing it and which product and platform versions you are using.
WebUtil is included in Forms 10.1.2, so there is no need to download it. In version 9, you would need to manually download and configure it from here:
http://www.oracle.com/technology/products/forms/htdocs/webutil/webutil.htm -
Automator app that works with files behaves randomly
I have a VERY simple automator application that just copies a file, renames it, copies it again, renames it again, and that's all. It's all done with standard automator steps. For some reason, it behaves randomly. Sometimes it does the right thing; sometimes it misses one of the copies; sometimes it misses one of the renames; sometimes it misses two steps. I can get it to work more consistently by putting one second pauses in between the steps, but this seems like a ridiculous requirement. It is really the case that the automator is not synchronized to the termination of each step so that one can expect scripts to execute consistently w/o having to put in delays????? Certainly a shell script would never misbehave in this manner.
AppCleaner, it's free but just as good as the others.
http://www.freemacsoft.net/AppCleaner/index.php
Maybe you are looking for
-
Will there be a fix for Firefox's problems with Hotmail. I have gone back to 3.5.9 but mostly I am disappointed by the lack of action on this serious problem where a major and critical feature of a major international website is unavailable in the Fi
-
New iCal - where is my monthly/list view??
What is with the new iCal?? I desperately want the old version back! I NEED to be able to look at the whole month at a time with a scrolling list on the bottom of what is going on when I click on the day. This particular view is now gone! Every p
-
Display a file with in the ADF screen in the edit mode.(RTF or Word format)
Hi , As per my business need i need to display a file (.doc or .pdf) in the ADF screen in the edit mode. Later user can be able to save the document . As of now i am using a separate editor for edit the document. but that editor is supporting only fo
-
Clustering across File systems
Folks! I have a question... Does Weblogic support a clustering env. across filesystems. We are running into this problem. We are using the NES proxy lib to switch between two weblogic app server. If both are started from
-
In Design CS 6 crashing on resizing a text frame
Some specifics: 2 MACs networked via cable directly connecting the two. one MAC Pro 12GB RAM 10.6 OS one Imac 16GB RAM 10.8 OS (this replaced another MAC Pro that we were told had a bad RAM controller when we started experiencing this odd crashing) I