Search Results

Search found 46908 results on 1877 pages for 'managing files and folder'.

Page 41/1877 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Create folder and insert file in Google Drive

    - by web_student
    I am trying to create a new folder in Drive and upload one (or more) files to that created folder. I use the code below, but the result is that both the folder and the file are placed in the root of my Drive. $client->setAccessToken($_SESSION['accessToken']); //create folder $folder_mime = "application/vnd.google-apps.folder"; $folder_name = 'New Folder'; $service = new Google_DriveService($client); $folder = new Google_DriveFile(); $folder->setTitle($folder_name); $folder->setMimeType($folder_mime); $service->files->insert($folder); //upload file $file_name = $_FILES["uploadFile"]["name"]; $file_mime = $_FILES["uploadFile"]["type"]; $file_path = $_FILES["uploadFile"]["tmp_name"]; $service = new Google_DriveService($client); $file = new Google_DriveFile(); $file->setParents(array($folder_name)); $file->setTitle($file_name); $file->setDescription('This is a '.$file_mime.' document'); $file->setMimeType($file_mime); $service->files->insert( $file, array( 'data' => file_get_contents($file_path) ) );

    Read the article

  • finding subfolder of a folder getting by getFolder method in asp

    - by Abhisheks.net
    hello guys, i am troubling from this problem , i want to find the list of folder but there is some problem , i have a support folder in root directory, first i have the subfolder of this "Support" folder then in each folder i have to find a specific say "x" folder and then in this x folder i want to check each file and folder. i am sending here code . please help me .... dim fs, fso, fo, s, x, f, filePath, a, sfPath set fs=Server.CreateObject("Scripting.FileSystemObject") set fo=fs.GetFolder(Server.MapPath("support/")) a = Split(pSku,"-",-1) for each x in fo.SubFolders sfPath= "support/" + x.Name + "/" + a(0) + "/" 'a(0) contains a folder name set s = fs.GetFolder(server.MapPath(sfPath)) set s = nothing next Please tell me solution ..

    Read the article

  • How to convert Xml files to Text Files 2

    - by John
    Hi all, I have around 8000 xml files that needs to be converted into text files. The text file must contain title, description and keywords of the xml file without the tags and removing other elements and attributes as well. In other words, i need to create 8000 text files containing the title,description and keywords of the xml file. I need codings for this to be done systematically. Any help would be greatly appreciated. Thanks in advance. Hey all thank you all so so much with your replies. Here's a sample of what my xml looks like: <?xml version="1.0"?> <metadata> <identifier>43productionsNightatthegraveyard</identifier> <title>Night at the graveyard</title> <collection>opensource_movies</collection> <mediatype>movies</mediatype> <resource>movies</resource> <upload_application appid="ccPublisher" version="2.2.1"/> <uploader>[email protected]</uploader> <description>una noche en el cementerio (terror)</description> <license>http://creativecommons.org/licenses/by-nc/3.0/</license> <title>Night at the graveyard</title> <format>Video</format> <adder>[email protected]</adder> <licenseurl>http://creativecommons.org/licenses/by-nc/3.0/</licenseurl> <year>2007</year> <keywords>Night,at,the,graveyard,43,productions</keywords> <holder>43 productions</holder> <publicdate>2007-04-11 19:52:28</publicdate> </metadata> And this would be the output: una noche en el cementerio (terror) Night at the graveyard Night,at,the,graveyard,43,productions This need to be saved with the same name but in text format. Thanks all so much if any more suggestions would be much appreciated.

    Read the article

  • to write log files in two different files

    - by Sun
    my application run on customized client framework,the client framework used log4net to log their own log files. we are(our application) has to use the same log4net to log our log files in our own path(say our customized path). currently the our log files are created but log are not writing in that file.it is writting in the client framework log file. searched lot of sites the link http://stackoverflow.com/questions/308436/log4net-programmatcially-specify-multiple-loggers-with-multiple-file-appenders helped me to configure the log4net config programatically, still im log statemets are not written in my log file.the code used as below public class TraceLog { private string message = string.Empty; private static ILog ILogger = null; private static TraceLog instance = new TraceLog(); private TraceLog() { SetLevel("Log4net.MainForm", "ALL"); AddAppender("Log4net.MainForm", CreateFileAppender("FileAppender", "C:\\mylog.log")); } public static TraceLog Instance { get { return instance; } } public void Debug(string logMessage) { message = PrepareLog(logMessage); ILogger.Debug(message); } protected string PrepareLog(string logMessage) { string message = GetFileMethodLineNumberInfo(); message += logMessage; return message; } protected string GetFileMethodLineNumberInfo() { StackTrace stackTrace = new StackTrace(true); // The position 3 is relative to the index of the specified method StackFrame stackFrame = stackTrace.GetFrame(3); return (stackFrame.GetMethod().DeclaringType.Name + "/" + stackFrame.GetMethod().Name + "/" + stackFrame.GetFileLineNumber() + ":"); } private static void SetLevel(string loggerName, string levelName) { ILogger = LogManager.GetLogger(loggerName); log4net.Repository.Hierarchy.Logger l = (log4net.Repository.Hierarchy.Logger)ILogger.Logger; l.Level = l.Hierarchy.LevelMap[levelName]; } private static void AddAppender(string loggerName, IAppender appender) { ILogger = LogManager.GetLogger(loggerName); log4net.Repository.Hierarchy.Logger l = (log4net.Repository.Hierarchy.Logger)ILogger.Logger; l.AddAppender(appender); } private static IAppender CreateFileAppender(string name, string fileName) { FileAppender appender = new FileAppender(); appender.Name = name; appender.File = fileName; appender.AppendToFile = true; //PatternLayout layout = new PatternLayout(); //layout.ConversionPattern = "%d [%t] %-5p %c [%x] - %m%n"; //layout.ActivateOptions(); //appender.Layout = layout; appender.ActivateOptions(); return appender; } } } anyone pls help how to solve this

    Read the article

  • Managing trace files on Sql Server 2005

    - by Sophtware
    I need to manage the trace files for a database on Sql Server 2005 Express Edition. The C2 audit logging is turned on for the database, and the files that it's creating are eating up a lot of space. Can this be done from within Sql Server, or do I need to write a service to monitor these files and take the appropriate actions? I found the [master].[sys].[trace] table with the trace file properties. Does anyone know the meaning of the fields in this table?

    Read the article

  • How do XAML files associate with cs files?

    - by LLS
    It seems that XAML files should have corresponding .cs files in a C# project. I know Visual Studio does all the things for us. I'm just curious how they are linked together? I mean, are they specified in the project file, or just because they have the same names? And also, App.xaml file specifies the startup file, but how does the compiler know? Is it possible to appoint another file other than App.xaml to do the same things as App.xaml does?

    Read the article

  • How are files (especially audio files) organized internally?

    - by mystify
    I try to grok that: Apple is talking about "packets" in audio files, and there is a fancy function called AudioFileReadPackets which takes a lot of arguments. One of them specifies the "start packet", and another one the number of packets which you want to read. So I imagine an audio file to look like this, internally: It's made up of a lot of packets. If it's an audio file which has an variable bit rate format, then every packet may have a different size. If the file has an constant bit rate format, then every packet is the same size. So an audio file is like a truck full of boxes, and every box contains some interesting stuff. Is that correct? Does it apply to any kind of file? Is this how files actually look like?

    Read the article

  • How to delete files with a Python script from a FTP server which are older than 7 days?

    - by Tom
    Hello I would like to write a Python script which allows me to delete files from a FTP Server after they have reached a certain age. I prepared the scipt below but it throws the error message: WindowsError: [Error 3] The system cannot find the path specified: '/test123/*.*' Do someone have an idea how to resolve this issue? Thank you in advance! import os, time from ftplib import FTP ftp = FTP('127.0.0.1') print "Automated FTP Maintainance" print 'Logging in.' ftp.login('admin', 'admin') # This is the directory that we want to go to directory = 'test123' print 'Changing to:' + directory ftp.cwd(directory) files = ftp.retrlines('LIST') print 'List of Files:' + files # ftp.remove('LIST') #------------------------------------------- now = time.time() for f in os.listdir(directory): if os.stat(f).st_mtime < now - 7 * 86400: if os.directory.isfile(f): os.remove(os.directory.join(directory, f)) #except: #exit ("Cannot delete files") #------------------------------------------- print 'Closing FTP connection' ftp.close()

    Read the article

  • Analyze VS2010 C# projects and report files on disk not part of the projects?

    - by Lasse V. Karlsen
    I discovered earlier tonight that files and folders I have removed from my C# projects are apparently still on disk, even though my Visual Studio Mercurial plugin seems to do a good job of deleting them when I delete them in Visual Studio. It must have hickuped when it came to these files. So I wondered... Does anyone have a script or similar, or know of something, that will look at my .csproj files and report extra files and folders on my disk that isn't part of the project files? I just want to clean up my repository contents.

    Read the article

  • Fragmented Log files could be slowing down your database

    - by Fatherjack
    Something that is sometimes forgotten by a lot of DBAs is the fact that database log files get fragmented in the same way that you get fragmentation in a data file. The cause is very different but the effect is the same – too much effort reading and writing data. Data files get fragmented as data is changed through normal system activity, INSERTs, UPDATEs and DELETEs cause fragmentation and most experienced DBAs are monitoring their indexes for fragmentation and dealing with it accordingly. However, you don’t hear about so many working on their log files. How can a log file get fragmented? I’m glad you asked. When you create a database there are at least two files created on the disk storage; an mdf for the data and an ldf for the log file (you can also have ndf files for extra data storage but that’s off topic for now). It is wholly possible to have more than one log file but in most cases there is little point in creating more than one as the log file is written to in a ‘wrap-around’ method (more on that later). When a log file is created at the time that a database is created the file is actually sub divided into a number of virtual log files (VLFs). The number and size of these VLFs depends on the size chosen for the log file. VLFs are also created in the space added to a log file when a log file growth event takes place. Do you have your log files set to auto grow? Then you have potentially been introducing many VLFs into your log file. Let’s get to see how many VLFs we have in a brand new database. USE master GO CREATE DATABASE VLF_Test ON ( NAME = VLF_Test, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.ROCK_2008\MSSQL\DATA\VLF_Test.mdf', SIZE = 100, MAXSIZE = 500, FILEGROWTH = 50 ) LOG ON ( NAME = VLF_Test_Log, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.ROCK_2008\MSSQL\DATA\VLF_Test_log.ldf', SIZE = 5MB, MAXSIZE = 250MB, FILEGROWTH = 5MB ); go USE VLF_Test go DBCC LOGINFO; The results of this are firstly a new database is created with specified files sizes and the the DBCC LOGINFO results are returned to the script editor. The DBCC LOGINFO results have plenty of interesting information in them but lets first note there are 4 rows of information, this relates to the fact that 4 VLFs have been created in the log file. The values in the FileSize column are the sizes of each VLF in bytes, you will see that the last one to be created is slightly larger than the others. So, a 5MB log file has 4 VLFs of roughly 1.25 MB. Lets alter the CREATE DATABASE script to create a log file that’s a bit bigger and see what happens. Alter the code above so that the log file details are replaced by LOG ON ( NAME = VLF_Test_Log, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.ROCK_2008\MSSQL\DATA\VLF_Test_log.ldf', SIZE = 1GB, MAXSIZE = 25GB, FILEGROWTH = 1GB ); With a bigger log file specified we get more VLFs What if we make it bigger again? LOG ON ( NAME = VLF_Test_Log, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.ROCK_2008\MSSQL\DATA\VLF_Test_log.ldf', SIZE = 5GB, MAXSIZE = 250GB, FILEGROWTH = 5GB ); This time we see more VLFs are created within our log file. We now have our 5GB log file comprised of 16 files of 320MB each. In fact these sizes fall into all the ranges that control the VLF creation criteria – what a coincidence! The rules that are followed when a log file is created or has it’s size increased are pretty basic. If the file growth is lower than 64MB then 4 VLFs are created If the growth is between 64MB and 1GB then 8 VLFs are created If the growth is greater than 1GB then 16 VLFs are created. Now the potential for chaos comes if the default values and settings for log file growth are used. By default a database log file gets a 1MB log file with unlimited growth in steps of 10%. The database we just created is 6 MB, let’s add some data and see what happens. USE vlf_test go -- we need somewhere to put the data so, a table is in order IF OBJECT_ID('A_Table') IS NOT NULL DROP TABLE A_Table go CREATE TABLE A_Table ( Col_A int IDENTITY, Col_B CHAR(8000) ) GO -- Let's check the state of the log file -- 4 VLFs found EXECUTE ('DBCC LOGINFO'); go -- We can go ahead and insert some data and then check the state of the log file again INSERT A_Table (col_b) SELECT TOP 500 REPLICATE('a',2000) FROM sys.columns AS sc, sys.columns AS sc2 GO -- insert 500 rows and we get 22 VLFs EXECUTE ('DBCC LOGINFO'); go -- Let's insert more rows INSERT A_Table (col_b) SELECT TOP 2000 REPLICATE('a',2000) FROM sys.columns AS sc, sys.columns AS sc2 GO 10 -- insert 2000 rows, in 10 batches and we suddenly have 107 VLFs EXECUTE ('DBCC LOGINFO'); Well, that escalated quickly! Our log file is split, internally, into 107 fragments after a few thousand inserts. The same happens with any logged transactions, I just chose to illustrate this with INSERTs. Having too many VLFs can cause performance degradation at times of database start up, log backup and log restore operations so it’s well worth keeping a check on this property. How do we prevent excessive VLF creation? Creating the database with larger files and also with larger growth steps and actively choosing to grow your databases rather than leaving it to the Auto Grow event can make sure that the growths are made with a size that is optimal. How do we resolve a situation of a database with too many VLFs? This process needs to be done when the database is under little or no stress so that you don’t affect system users. The steps are: BACKUP LOG YourDBName TO YourBackupDestinationOfChoice Shrink the log file to its smallest possible size DBCC SHRINKFILE(FileNameOfTLogHere, TRUNCATEONLY) * Re-size the log file to the size you want it to, taking in to account your expected needs for the coming months or year. ALTER DATABASE YourDBName MODIFY FILE ( NAME = FileNameOfTLogHere, SIZE = TheSizeYouWantItToBeIn_MB) * – If you don’t know the file name of your log file then run sp_helpfile while you are connected to the database that you want to work on and you will get the details you need. The resize step can take quite a while This is already detailed far better than I can explain it by Kimberley Tripp in her blog 8-Steps-to-better-Transaction-Log-throughput.aspx. The result of this will be a log file with a VLF count according to the bullet list above. Knowing when VLFs are being created By complete coincidence while I have been writing this blog (it’s been quite some time from it’s inception to going live) Jonathan Kehayias from SQLSkills.com has written a great article on how to track database file growth using Event Notifications and Service Broker. I strongly recommend taking a look at it as this is going to catch any sneaky auto grows that take place and let you know about them right away. Hassle free monitoring of VLFs If you are lucky or wise enough to be using SQL Monitor or another monitoring tool that let’s you write your own custom metrics then you can keep an eye on this very easily. There is a custom metric for VLFs (written by Stuart Ainsworth) already on the site and there are some others there are very useful so take a moment or two to look around while you are there. Resources MSDN – http://msdn.microsoft.com/en-us/library/ms179355(v=sql.105).aspx Kimberly Tripp from SQLSkills.com – http://www.sqlskills.com/BLOGS/KIMBERLY/post/8-Steps-to-better-Transaction-Log-throughput.aspx Thomas LaRock at Simple-Talk.com – http://www.simple-talk.com/sql/database-administration/monitoring-sql-server-virtual-log-file-fragmentation/ Disclosure I am a Friend of Red Gate. This means that I am more than likely to say good things about Red Gate DBA and Developer tools. No matter how awesome I make them sound, take the time to compare them with other products before you contact the Red Gate sales team to make your order.

    Read the article

  • way to access Win networked folder on Mac like one can with Run box on Win

    - by Nik
    I was wondering if there is a way to access a deeply nested shared networked Windows folder on Mac (Lion) like you can on windows with the Run box. say I know the folder I want is on the computer Homer-PC, the G drive, the folder ABC/234/CDE on Windows I can Win+R then \Homer-PC\G\ABC\234\CDE return and it should open that folder directly, Is there something similar on the Mac? Or is there some tiny apps that I can use to do that? Thank You

    Read the article

  • Sorting by Folder and Received in Outlook 2010

    - by Simon Martin
    I want to sort my Unread Mail folder by Folder and within that by Recieved (oldest on top). I've found that by clicking the "In Folder" header, holding down Shift and clicking Received twice I can get the sort I want but if I leave that view (for example checking the calendar) and then return that the sort order has not kept things as I expect. Looking in the View Settings Sort it shows "In Folder (ascending), Received (ascending)" but that doesn't create the same view as using the shift button...

    Read the article

  • Delete a folder in the currently logged in user's profile

    - by Dan Cole
    I am trying to create a login script, or bat file to delete the folder located in the following directory. I would like the whole folder deleted with all of its contents "Juniper Networks". This is on a terminal server - C:\Users(username)\AppData\Roaming\Juniper Networks I can write a script for each username, but want a script to put in the startup folder that deleted the folder of the current user each time they login.

    Read the article

  • Rewrite /folder to / Using .htaccess

    - by manyxcxi
    I am trying to redirect /folder to / using .htaccess but all am I getting is the Apache HTTP Server Test Page. My root directory looks like this: / .htaccess -/folder -/folder2 -/folder3 My .htaccess looks like this: RewriteEngine On RewriteCond %{REQUEST_URI} !^/folder/ RewriteRule (.*) /folder/$1 What am I doing wrong? I checked my httpd.conf (I'm running Centos) and the mod_rewrite library is being loaded. As a side note, my server is not a www server, it's simply a virtual machine so it's hostname is centosvm.

    Read the article

  • AHK for creating folder + subfolders

    - by quanto
    I need an AHK script which creates: a folder in the currently open folder in Windows Explorer (under Windows 7), whose name consists the current date in the format (yyyy-mm-dd) the text which is currently in the clipboard the newly created folder must contain 3 subfolders, named "1", "2", and "3" I'd like to copy a few words (e.g. Testing Testing Testing) from another application, go to a location on my harddisk (using Windows Explorer), activate the hotkey, and AHK will create for me a folder named: 2012-06-04 Testing Testing Testing with subfolders "1", "2", and "3".

    Read the article

  • Windows Task Scheduler to move files to a different folder

    - by user4941
    I have my phone set up so that when it takes photos, it sends them to file on my desktop. I would like to have a task run once a day that checks the folder and then Creates a folder on the external drive with the day embedded (e.g. Photos-2012-10-08) Move all the files from desktop folder to the newly created folder How do you go about creating a script that the Windows Task Scheduler can use to accomplish that goal?

    Read the article

  • How many files in a directory is too many?

    - by Kip
    Does it matter how many files I keep in a single directory? If so, how many files in a directory is too many, and what are the impacts of having too many files? (This is on a Linux server.) Background: I have a photo album website, and every image uploaded is renamed to an 8-hex-digit id (say, a58f375c.jpg). This is to avoid filename conflicts (if lots of "IMG0001.JPG" files are uploaded, for example). The original filename and any useful metadata is stored in a database. Right now, I have somewhere around 1500 files in the images directory. This makes listing the files in the directory (through FTP or SSH client) take a few seconds. But I can't see that it has any affect other than that. In particular, there doesn't seem to be any impact on how quickly an image file is served to the user. I've thought about reducing the number of images by making 16 subdirectories: 0-9 and a-f. Then I'd move the images into the subdirectories based on what the first hex digit of the filename was. But I'm not sure that there's any reason to do so except for the occasional listing of the directory through FTP/SSH.

    Read the article

  • where do i put html files in my web-app folder for a lift project with maven?

    - by egervari
    I'm new to Lift framework for scala. For some reason, index.html resides in the web-app directory, and when I start up jetty, http://localhost:8080/ will point to that index.html file just fine. However, if I put a login.html file in the same folder as the index.html, and then go http://localhost:8080/login, Lift does not serve the file. Where do I need to put the files to get them register? I am a little lost because the behaviour only seems to work for index.html and nothing else. This is what happens when I view source in Chrome: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <body>The Requested URL /login was not found on this server</body> </html>

    Read the article

  • How do I drag and drop a folder in Winforms?

    - by Tuntuni
    I would like to know how to drag & drop the folder and get its name. I already know how to do it with a file, but I'm not really sure how to modify it to be able to drag folders as well. Here's the code of the event that is triggered when a file is dropped. private void checkedListBox_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { //I'm only interested in the first file, even if there were multiple files //dropped string fileName = ((string[])e.Data.GetData(DataFormats.FileDrop))[0]; } } Thanks, Tuntuni.

    Read the article

  • Error on `gksu nautilus` because Nautilus cannot create folder "/root/.config/nautilus"

    - by luciehn
    I have a problem executing nautilus in root mode on a fresh installation. I just installed Ubuntu 12.04, and the first thing I did after first boot was run the command gksudo nautilus, I've got this error message: Nautilus could not create the required folder "/root/.config/nautilus". Before running Nautilus, please create the following folder, or set permissions such that Nautilus can create it. I am triple booting Windows 7, Fedora 17 and Ubuntu 12.04. My partition configuration is this: sda1 --> (ntfs) Windows 7 boot partition sda2 --> (ntfs) Windows 7 sda3 --> (ext4) Fedora 17 /boot partition sda4 --> Extended partition sda5 --> LVM Fedora 17, with 3 partitions inside (/, /home and swap) sda6 --> (ext4) Ubuntu 12.04 /boot partition sda7 --> (ext4) Ubuntu 12.04 swap partition sda8 --> (ext4) Ubuntu 12.04 / partition sda9 --> (ext4) Ubuntu 12.04 /home partition The MBR is using Windows, so is this one which is controlling the machine boot menu. Looks like Nautilus does not have permission to write in /root/.config, but it should right? I prefer asking before doing nothing wrong. Any ideas?

    Read the article

  • apt-mirror - Changing source mirror creates new folder for downloads

    - by I Kazi
    I have a local Ubuntu mirror running on ubuntu 10.04 in my office which uses archive.ubuntu.com to download updates and releases. I have been running this mirror since Ubuntu's Hardy Heron release. It downloads everything under /export/ubuntu-repo1/apt-mirror/mirror/archive.ubuntu.com/ folder. Recently I came to know that the mirror in India i.e. in.archive.ubuntu.com is a lot faster for me than http://archive.ubuntu.com which is based in UK. Therefore to download latest release QUANTAL QUETZAL I configured Indian mirror in /etc/apt/mirror.list After making this change and leaving apt-mirror to run overnight I found that it downloaded everything to a new folder called "in.archive.ubuntu.com" so now I have two folders where apt-mirror downloads updates. /export/ubuntu-repo1/apt-mirror/mirror/archive.ubuntu.com/ /export/ubuntu-repo1/apt-mirror/mirror/in.archive.ubuntu.com/ Now, since apache does not have "in.archive.ubuntu.com" configured, Ubuntu clients are unable to access QUANTAL QUETZAL release and its updates. My question is: Is there a way I could copy everything downloaded under "in.archive.ubuntu.com" to "archive.ubuntu.com" so all new updates of the latest release become accessible to Ubuntu clients? Secondly, Can I configure apt-mirror to download everything to archive.ubuntu.com even using Indian mirror? Thanks a lot for your help in advance. I Kazi

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >